Join waitlist
Strategies / Trend / EMA 9 20 Trend Filtered Long

EMA 9 20 Trend Filtered Long

Buys when the 9-period EMA crosses above the 20-period EMA while the close is above the 200-period EMA. Sells when the close crosses below the 20-period EMA, with no stop or target.

TrendLong onlySwingUSD/JPY1 hour
1.22Profit factor
477,920Net profit USD
30.31%Win rate
1,686Trades
-97,140Max drawdown
283Avg trade

Best run of 19. USD/JPY, 1 hour, spread 1, from run pf:2026-10-10-USDJPY-1h.tsv:2.

Entry rules, long

  1. The close is above the 200-period EMA

Exit rules

  1. The close crosses under the 20-period EMA, closing the long position

Test conditions

PeriodUp to 2026-10-10
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-10

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest run1 hour1.22 1,68630.31477,920 USD-97,140
USD/JPYDailyn/a 14727.89348,120 USD-298,260
USD/JPY4 hoursn/a 43136.19317,670 USD-113,950
USD/JPY30 minn/a 2,45928.02235,390 USD-115,880
EUR/USDDailyn/a 13432.8435,592 USD-23,915
Nikkei 225Dailyn/a 16232.1019,572 USD-7,823
Dow JonesDailyn/a 24542.8613,822 EUR-3,783
Nikkei 2251 hourn/a 1,32329.4811,207 USD-7,279
DAX 40Dailyn/a 22938.8610,118 EUR-3,054
Silver4 hoursn/a 37928.769,506 USD-5,999
Dow Jones4 hoursn/a 16034.389,077 EUR-3,415
Nasdaq 100Dailyn/a 20633.015,659 EUR-3,300
DAX 404 hoursn/a 49233.544,704 EUR-2,718
Brent Crude30 minn/a 1,64830.462,927 EUR-2,558
FTSE 100Dailyn/a 19440.211,988 EUR-1,266
GoldDailyn/a 20230.201,401 EUR-614
S&P 500Dailyn/a 26238.171,300 EUR-586
Gold4 hoursn/a 38636.531,046 EUR-472
Gold5 minn/a 2,74725.99514 EUR-510

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

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

DEFPARAM CumulateOrders = false

emashort = ExponentialAverage[9](close)
emalong = ExponentialAverage[20](close)
ematrend = ExponentialAverage[200](close)

10 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

EMA
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run EMA 9 20 Trend Filtered 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 was USD/JPY, 1 hour, with a profit factor of 1.22 over 1,686 trades.

How large was the drawdown?

The best run had a maximum drawdown of 97,140 USD at the tested position size, against a net result of 477,920 USD.

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Reversal Pattern With Chaikin Volatility

Uses the same indicator.

2.26 PF · 6,872 trades

Trend Surfer

Best run on the same market, USD/JPY.

1.04 PF · 10,813 trades

EMA 20/50 Cross

Also a trend strategy.

1.22 PF · 1,288 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