Join waitlist
Strategies / Mean reversion / SMA Dip Buy With Exit Limits

SMA Dip Buy With Exit Limits

Buys when the 2 period SMA dips more than 0.01 below the 10 period SMA, measured as a ratio. Closes the trade when the close rises more than 0.01 above the entry, falls more than 0.03 below it, or after 30 bars.

Mean reversionLong onlySwingDAX 40Daily
n/aProfit factor
10,321Net profit EUR
65.60%Win rate
936Trades
-3,022Max drawdown
11.03Avg trade

Best run of 24. DAX 40, Daily, spread 3, from run sweeps:2026-10-04-DAX40-D-opt.tsv:25.

Entry rules, long

  1. Signals are only checked after bar 10.

Exit rules

  1. The ratio of the close to the entry close, minus 1, is above 0.01.
  2. The trade has lasted more than 30 bars.

Test conditions

PeriodUp to 2026-10-04
InstrumentDAX 40, Daily
Spread3 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-04

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
DAX 40Best runDailyn/a 93665.6010,321 EUR-3,022
USD/JPY4 hoursn/a 11564.35204,530 USD-119,500
Nikkei 225Dailyn/a 84469.1947,231 USD-16,735
EUR/USD1 hourn/a 4156.1029,402 USD-13,891
Dow JonesDailyn/a 73473.4323,255 EUR-6,437
Nikkei 2251 hourn/a 46267.9713,606 USD-9,337
Nasdaq 100Dailyn/a 82464.688,687 EUR-5,065
Nasdaq 1004 hoursn/a 62772.098,370 EUR-3,978
FTSE 100Dailyn/a 58273.547,027 EUR-1,971
Nasdaq 1001 hourn/a 67262.055,409 EUR-3,604
Nikkei 22515 minn/a 14461.815,288 USD-4,313
Dow Jones30 minn/a 12364.234,156 EUR-2,928
FTSE 10030 minn/a 16167.702,473 EUR-756
FTSE 1004 hoursn/a 40270.402,254 EUR-2,152
S&P 500Dailyn/a 77370.251,697 EUR-947
Dow Jones5 minn/a 785.711,612 EUR-424
Silver1 minn/a 2268.181,466 USD-1,212
Dow Jones3 minn/a 475.001,295 EUR-444
Nikkei 2252 minn/a 666.671,038 USD-630
S&P 5001 hourn/a 44264.48968 EUR-787
Gold3 minn/a 2673.08313 EUR-236
GBP/USD15 minn/a 580.00243 USD-125
FTSE 1005 minn/a 4100.00212 EUR-101
GBP/USD10 minn/a 366.67182 USD-88.30

Charts

Results by run

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

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// SMA Dip Buy With Exit Limits
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long only
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE bought = 0
ONCE entrybar = 0

smafast = Average[2](close)
smaslow = Average[10](close)

14 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

SMA
Read this firstKnown weaknesses2 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run SMA Dip Buy With Exit Limits 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 24 market and timeframe combinations. The best run by trade count was DAX 40, Daily, with 936 trades.

How large was the drawdown?

The best run had a maximum drawdown of 3,022 EUR at the tested position size, against a net result of 10,320 EUR.

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

Heikin Ashi Color Flip

Best run on the same market, DAX 40.

1.12 PF · 3,692 trades

ATR Band

Also a mean reversion strategy.

10.31 PF · 53 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