Join waitlist
Strategies / Trend / Trend Filtered MACD Long

Trend Filtered MACD Long

The strategy buys when the MACD line is above its 9 period signal line, and below the 200 period average also requires the close above the 20 period EMA. It closes when the MACD line falls below that signal.

TrendLong onlySwingUSD/JPY1 hour
n/aProfit factor
438,020Net profit USD
36.87%Win rate
4,413Trades
-298,720Max drawdown
99.26Avg trade

Best run of 19. USD/JPY, 1 hour, spread 1, from run sweeps:2026-10-11-USDJPY-1h-opt.tsv:17.

Entry rules, long

  1. If the close is at or below the 200 period average, the close must also be above the 20 period EMA.
  2. No long position is open.

Exit rules

  1. When the close is at or above the 200 period average, the close must also be below the 20 period EMA for the exit.

Test conditions

PeriodUp to 2026-10-11
InstrumentUSD/JPY, 1 hour
Spread1 points
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-10-11

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest run1 hourn/a 4,41336.87438,020 USD-298,720
USD/JPY4 hoursn/a 1,10340.25665,750 USD-345,040
Nikkei 225Dailyn/a 35738.3833,898 USD-12,145
SilverDailyn/a 41733.5731,558 USD-26,621
Nikkei 2254 hoursn/a 80739.0330,108 USD-11,583
Dow JonesDailyn/a 48142.4118,155 EUR-6,075
DAX 401 hourn/a 3,54137.5312,443 EUR-4,804
DAX 404 hoursn/a 98940.1411,574 EUR-4,264
DAX 40Dailyn/a 49540.6111,219 EUR-4,956
Nasdaq 1004 hoursn/a 99639.7611,105 EUR-4,598
Nasdaq 100Dailyn/a 36342.4210,390 EUR-5,580
Dow Jones4 hoursn/a 33438.329,579 EUR-7,391
Nasdaq 1001 hourn/a 3,80635.315,494 EUR-5,147
FTSE 100Dailyn/a 38141.214,062 EUR-2,867
Gold4 hoursn/a 1,00639.962,582 EUR-910
GoldDailyn/a 43637.612,424 EUR-1,369
S&P 500Dailyn/a 49638.312,313 EUR-1,057
Gold1 hourn/a 3,76735.282,029 EUR-744
S&P 5004 hoursn/a 1,02240.021,728 EUR-982

Charts

Results by run

Top 10 of 19 runs. The full list is in the table above.

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Trend Filtered MACD Long
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long only
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

sma = Average[200](close)
ema = ExponentialAverage[20](close)
myMacd = ExponentialAverage[12](close) - ExponentialAverage[26](close)
sig = ExponentialAverage[9](myMacd)
delta = myMacd - sig

21 more lines: the entry and exit rules.

Setup

How to load it

  1. Copy the code with the copy button on the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Indicators used

MACDEMASMA
Read this firstKnown weaknesses3 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 298,720 USD is large next to the net profit of 438,020 USD.
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run Trend Filtered MACD Long in ProOrder?

Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.

Which markets was it tested on?

It was tested on 19 market and timeframe combinations. The best run by trade count was USD/JPY, 1 hour, with 4,413 trades.

How large was the drawdown?

The best run had a maximum drawdown of 298,720 USD at the tested position size, against a net result of 438,020 USD.

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

EMA 8 21 RSI Filtered Bracket

Best run on the same market, USD/JPY.

1.09 PF · 6,194 trades

ADX Filtered EMA Cross

Also a trend strategy.

1.15 PF · 607 trades

Get the full rules, the complete code and the ProRealAlgos portfolio as a member.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs