Join waitlist
Strategies / Mean reversion / EMA Deviation MACD Reversal

EMA Deviation MACD Reversal

The strategy buys after price dips below its 18-period EMA and turns up, with MACD crossing above its signal line from a deeply negative area. It sells short on the mirror condition and applies a 7.2222% stop and a 1.3333% profit target.

Mean reversionLong & shortSwingFTSE 1001 hour
1.80Profit factor
5,516Net profit EUR
89.19%Win rate
148Trades
-1,174Max drawdown
37.27Avg trade

Best run of 25. FTSE 100, 1 hour, spread 2, from run pf:2026-10-12-FTSE100-1h.tsv:1.

Entry rules, long

  1. When flat, the close is more than 0.0889% of price below the 18-period EMA.
  2. The gap to the EMA rises this bar after falling on the previous bar.
  3. When these conditions hold, one contract is bought at market.

Entry rules, short

  1. When flat, the close is more than 0.0889% of price above the 18-period EMA.
  2. The gap to the EMA falls this bar after rising on the previous bar.
  3. When these conditions hold, one contract is sold short at market.

Exit rules

  1. While short, a MACD long signal reverses the position once the close is more than 0.7222% below the entry price.
  2. A long closes at market when the close is more than 1.3333% above the entry price.
  3. A short closes at market when the close is more than 1.3333% below the entry price.
  4. A stop loss is set 7.2222% from the entry price.

Test conditions

PeriodUp to 2026-10-12
InstrumentFTSE 100, 1 hour
Spread2 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
FTSE 100Best run1 hour1.80 14889.195,516 EUR-1,174
USD/JPY15 minn/a 10100.00179,620 USD-108,250
USD/JPY10 minn/a 6100.00127,310 USD-113,040
EUR/USD4 hoursn/a 7387.6735,405 USD-23,363
USD/JPY3 minn/a 1100.0021,220 USD-8,890
USD/JPY5 minn/a 1100.0020,220 USD-5,550
Nikkei 22510 minn/a 6687.8815,797 USD-9,116
Dow Jones15 minn/a 5589.0910,108 EUR-5,386
Dow Jones4 hoursn/a 4386.059,705 EUR-5,473
US Crude Oil1 hourn/a 34884.778,884 EUR-2,305
Nikkei 2251 hourn/a 18182.877,485 USD-7,067
Nikkei 2251 minn/a 7100.005,858 USD-2,670
US Crude Oil3 minn/a 9789.695,258 EUR-1,534
US Crude Oil30 minn/a 42182.664,866 EUR-4,196
GBP/USD30 minn/a 21100.004,422 USD-526
US Crude Oil5 minn/a 12085.833,245 EUR-2,162
Brent Crude3 minn/a 6888.243,155 EUR-1,093
FTSE 100Dailyn/a 6485.941,921 EUR-837
EUR/USD10 minn/a 1100.001,417 USD-567
Gold3 minn/a 1794.12741 EUR-452
GBP/USD10 minn/a 5100.00711 USD-459
Gold5 minn/a 3387.88651 EUR-636
Dow Jones2 minn/a 1100.00627 EUR-465
FTSE 1003 minn/a 1100.00113 EUR-112
S&P 5002 minn/a 1100.0088.88 EUR-55.73

Charts

Results by run

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

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// EMA Deviation MACD Reversal
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long & short
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

ema = ExponentialAverage[18](close)
diff = close - ema
myMacd = (ExponentialAverage[12](close) - ExponentialAverage[26](close)) * 3
signal = Average[9](myMacd)
mthr = close * 0.8889 / 100
dthr = close * 0.0889 / 100

39 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

EMAMACDSMA
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 Deviation MACD Reversal 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 25 market and timeframe combinations. The best run was FTSE 100, 1 hour, with a profit factor of 1.80 over 148 trades.

How large was the drawdown?

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

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

DAX Survivor

Best run on the same market, FTSE 100.

1.17 PF · 1,514 trades

Dual Setup Band Dip Buyer

Also a mean reversion strategy.

1.80 PF · 195 trades

Want strategies that are already part of a live portfolio? Join the ProRealAlgos waitlist.

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