Join waitlist
Strategies / Mean reversion / EMA Distance Double Touch

EMA Distance Double Touch

The strategy buys after the distance from a 200-period EMA drops below a negative 0.756% of close level and then climbs back above it. It closes the long after the distance rises above a positive 0.756% level and then falls back below it.

Mean reversionLong onlySwingS&P 5004 hours
3.27Profit factor
4,226Net profit EUR
72.83%Win rate
184Trades
-957Max drawdown
22.97Avg trade

Best run of 52. S&P 500, 4 hours, spread 1, from run pf:2026-10-05-USA500-4h.tsv:10.

Entry rules, long

  1. The distance from the 200-period EMA crosses below minus 0.756% of the close.

Exit rules

  1. The distance crosses above plus 0.756% of the close, which arms the exit.

Test conditions

PeriodUp to 2026-10-05
InstrumentS&P 500, 4 hours
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
S&P 500Best run4 hours3.27 18472.834,226 EUR-957
Nasdaq 1001 hour2.36 50269.9225,774 EUR-3,358
S&P 50030 min1.87 39273.215,113 EUR-864
S&P 5001 hour1.69 38271.993,817 EUR-721
Nasdaq 10030 min1.53 49573.3314,518 EUR-3,559
Nikkei 22530 min1.47 54371.4538,720 USD-8,785
USD/JPY30 minn/a 17762.71369,810 USD-219,900
USD/JPY10 minn/a 6368.25269,530 USD-264,200
Nikkei 22510 minn/a 31068.3929,957 USD-10,442
Dow Jones4 hoursn/a 6473.4425,633 EUR-7,798
Nikkei 22515 minn/a 37367.8325,023 USD-7,917
Dow JonesDailyn/a 10643.4023,468 EUR-6,572
Nikkei 2254 hoursn/a 18768.4523,005 USD-9,813
Nikkei 2255 minn/a 20969.3821,496 USD-10,389
Nikkei 2251 hourn/a 40772.4820,739 USD-10,288
Dow Jones30 minn/a 17569.1417,894 EUR-10,471
Nasdaq 1004 hoursn/a 20064.5017,434 EUR-4,640
Dow Jones1 hourn/a 12371.5414,331 EUR-4,874
DAX 4030 minn/a 51572.0413,765 EUR-4,032
Dow Jones10 minn/a 17767.2313,554 EUR-7,323
Nasdaq 10015 minn/a 40266.4212,299 EUR-4,844
Nikkei 2252 minn/a 12459.6811,983 USD-9,745
DAX 401 hourn/a 45672.3711,011 EUR-4,666
Nikkei 2253 minn/a 15259.8710,557 USD-10,353
DAX 404 hoursn/a 22061.3610,456 EUR-4,184
Nasdaq 100Dailyn/a 7044.2910,232 EUR-4,009
Nasdaq 1005 minn/a 15965.419,567 EUR-4,707
Nasdaq 10010 minn/a 30667.329,053 EUR-4,599
Nasdaq 1001 minn/a 3066.678,459 EUR-2,482
GBP/USDDailyn/a 9365.597,915 USD-6,338
DAX 4010 minn/a 21370.897,443 EUR-4,005
DAX 4015 minn/a 30970.557,275 EUR-4,328
Nasdaq 1002 minn/a 6065.007,264 EUR-3,037
US Crude OilDailyn/a 10734.586,832 EUR-5,689
DAX 405 minn/a 10470.196,306 EUR-4,036
Nasdaq 1003 minn/a 10267.656,125 EUR-4,492
Dow Jones2 minn/a 2568.006,022 EUR-2,983
DAX 40Dailyn/a 10945.875,737 EUR-5,615
FTSE 10030 minn/a 40470.545,269 EUR-1,358
FTSE 1004 hoursn/a 19574.363,979 EUR-3,137
GoldDailyn/a 11249.113,172 EUR-1,108
FTSE 10010 minn/a 12873.442,942 EUR-1,200
S&P 500Dailyn/a 11537.392,627 EUR-1,698
S&P 50010 minn/a 19367.362,311 EUR-906
S&P 5005 minn/a 8368.672,137 EUR-1,297
S&P 50015 minn/a 27569.091,891 EUR-1,056
DAX 401 minn/a 1662.501,565 EUR-1,487
S&P 5002 minn/a 2268.181,446 EUR-449
S&P 5003 minn/a 5158.821,223 EUR-908
S&P 5001 minn/a 683.331,212 EUR-433
GBP/USD5 minn/a 1080.001,018 USD-919
FTSE 1001 minn/a 6100.00632 EUR-283

Charts

Results by run

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

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// EMA Distance Double Touch
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long only
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE minusfirst = 0
ONCE minussecond = 0
ONCE plusfirst = 0
ONCE plussecond = 0
ONCE inlong = 0

ema = ExponentialAverage[200](close)

45 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
Longer historyRe-run on up to 1,000,000 barsS&P 500 · 4 hours · older data 0.00 EUR

S&P 500 had no history beyond the standard run, so both runs used 28,000 bars.

S&P 500 · 4 hours

Bars available28,000
Net, standard 200,000-bar run4,225.92 EUR
Net, long run4,225.92 EUR
Net on the older data alone0.00 EUR
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 Distance Double Touch 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 52 market and timeframe combinations. The best run was S&P 500, 4 hours, with a profit factor of 3.27 over 184 trades.

How large was the drawdown?

The best run had a maximum drawdown of 957 EUR at the tested position size, against a net result of 4,226 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

RSI Crossover With Regression Bands

Also a mean reversion strategy.

3.22 PF · 163 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