Join waitlist
Strategies / Trend / EMA Trend Switch Long Only

EMA Trend Switch Long Only

This idea buys when the 24-period EMA moves above the 65-period EMA and closes the long when it moves back below. It trades only the long side, with one position at a time and no stop or target.

TrendLong onlySwingS&P 500Daily
3.35Profit factor
5,245Net profit EUR
37.74%Win rate
106Trades
-1,208Max drawdown
49.48Avg trade

Best run of 41. S&P 500, Daily, spread 1, from run pf:2026-10-12-USA500-D.tsv:24.

Entry rules, long

  1. The 24-period EMA moves to or above the 65-period EMA, switching the momentum state from negative to positive.

Exit rules

  1. No stop or target is coded.

Test conditions

PeriodUp to 2026-10-12
InstrumentS&P 500, Daily
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-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
S&P 500Best runDaily3.35 10637.745,245 EUR-1,208
USD/JPYDailyn/a 9228.261,538,410 USD-501,630
USD/JPY30 minn/a 1,46331.58564,040 USD-218,950
USD/JPY4 hoursn/a 28029.64422,670 USD-236,850
USD/JPY15 minn/a 1,50630.88417,260 USD-169,210
USD/JPY10 minn/a 1,55330.71355,890 USD-146,620
EUR/USDDailyn/a 9732.9967,355 USD-44,455
Nikkei 225Dailyn/a 8134.5743,763 USD-14,408
Nikkei 2254 hoursn/a 19735.5329,121 USD-8,549
Dow JonesDailyn/a 11235.7120,992 EUR-7,962
Nasdaq 100Dailyn/a 8151.8518,314 EUR-3,833
Nikkei 2251 hourn/a 77830.8518,088 USD-15,496
Nikkei 22530 minn/a 1,51432.1716,951 USD-11,636
Nikkei 2253 minn/a 1,51029.0116,545 USD-7,733
Nikkei 2252 minn/a 1,51829.1815,898 USD-7,212
Dow Jones1 hourn/a 31134.0813,405 EUR-5,556
Nasdaq 1001 hourn/a 89933.4812,913 EUR-4,581
US Crude OilDailyn/a 8338.5512,672 EUR-4,782
Nasdaq 1004 hoursn/a 24539.1811,755 EUR-6,469
Nasdaq 10030 minn/a 1,45133.2211,687 EUR-4,588
Nasdaq 10015 minn/a 1,48332.3710,602 EUR-3,711
Dow Jones15 minn/a 1,22630.5110,310 EUR-8,418
Dow Jones4 hoursn/a 8243.9010,059 EUR-8,173
DAX 404 hoursn/a 23539.159,856 EUR-3,562
DAX 4030 minn/a 1,50330.949,682 EUR-4,078
DAX 40Dailyn/a 12535.209,465 EUR-5,281
Nasdaq 1005 minn/a 1,45529.358,488 EUR-3,538
DAX 4015 minn/a 1,51931.146,549 EUR-3,323
Nasdaq 10010 minn/a 1,51429.395,929 EUR-4,036
DAX 401 hourn/a 88932.735,733 EUR-3,352
DAX 4010 minn/a 1,52529.313,652 EUR-3,570
GoldDailyn/a 10438.463,122 EUR-1,399
S&P 5004 hoursn/a 24537.552,990 EUR-754
Gold30 minn/a 1,46130.732,456 EUR-1,135
Gold1 hourn/a 88831.762,436 EUR-1,153
Gold4 hoursn/a 25433.461,970 EUR-1,595
Gold15 minn/a 1,54127.971,718 EUR-963
Gold5 minn/a 1,57129.471,711 EUR-862
S&P 5001 hourn/a 95134.381,491 EUR-1,073
Gold10 minn/a 1,58126.941,229 EUR-818
Gold3 minn/a 1,60628.46949 EUR-633

Charts

Results by run

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

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// EMA Trend Switch Long Only
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long only
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

fast = ExponentialAverage[24](close)
slow = ExponentialAverage[65](close)

15 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
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run EMA Trend Switch Long Only 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 41 market and timeframe combinations. The best run was S&P 500, Daily, with a profit factor of 3.35 over 106 trades.

How large was the drawdown?

The best run had a maximum drawdown of 1,208 EUR at the tested position size, against a net result of 5,245 EUR.

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

CCI Sign With EMA Alignment

Best run on the same market, S&P 500.

1.23 PF · 1,253 trades

EMA Crossover With ATR Brackets

Also a trend strategy.

3.36 PF · 809 trades

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

Copy trading on US indices is available to ProRealAlgos members as spots open.

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