Alan Ross

Alan Ross Forex

Free Forex Indicators, MetaTrader Tools and Honest Trading Guides

Learn Forex

Backtest vs Demo Account: 10 of 12 Tuned Setups Made Money in the Backtest, 1 of 12 Kept It on the Weeks That Followed

Key takeaways

  • I took six well-known rules (EMA 9/21, RSI 14, Bollinger 20/2, MACD 12/26/9, Supertrend 10/3, Stochastic 14/3/3), tuned the stop and target of each on the first two thirds of 16,926 EURUSD and 13,736 gold 5-minute bars, then ran the tuned version on the last third the way a demo account would fill it.
  • 10 of 12 tuned setups made money in the backtest. 1 of 12 still made money on the weeks that followed. The one survivor was the plain EMA 9/21 cross on gold.
  • The best-looking backtest fell the furthest: Stochastic on gold went from +$2.67 a trade in-sample to -$1.46 on the following weeks.
  • On EURUSD the demo-style fills took about 1.1 pips from every trade, and almost all of it was the spread. Entering on the next bar’s open and slippage on stops together moved results by less than 0.25 pips.
  • With costs in, the EURUSD rules finished 11 of 78 rule-weeks in profit. Three of the six never had a single green week in 13.

“Backtest first, then demo, then live” is the advice every beginner gets, and it is good advice. What nobody tells you is how much of the backtest usually survives the trip. I measured it on the same data I have used for every test on this blog, so the gap is shown in pips, not in opinions.

A demo account differs from a backtest in two ways. It fills your orders the way a broker does: at the next price, with a spread, with a little slippage. And it runs on the weeks after the ones you tested on. I measured both.

What exactly did I test?

Trader comparing a backtest report with a demo account
  • Data: EURUSD M5, June 3 to August 26, 2026, 16,926 bars. Gold (XAUUSD) M5, June 16 to August 26, 13,736 bars.
  • Six rules, all tested on their own earlier: EMA 9/21 cross, RSI 14 leaving 30/70, Bollinger 20/2 close back inside the band, MACD 12/26/9 signal cross, Supertrend 10/3 flip, Stochastic 14/3/3 cross below 20 or above 80.
  • Trade: one position at a time, stop and target in pips, closed after 24 bars (2 hours) if neither is hit.
  • Backtest fill: entry at the close of the signal bar, no cost, and if one bar touches both stop and target, the target counts.
  • Demo fill: entry at the next bar’s open, the stop wins if a bar touches both, spread of 1 pip (2 pips from 21:00 UTC, from my spread measurement), 0.3 pips of slippage on stops. Gold: $0.30 spread, $0.60 late.
  • Before and after: stop and target tuned on the first two thirds (to July 29 on EURUSD, to August 3 on gold) over 20 combinations from 10 to 45 pips, then run unchanged on the last third.

How many tuned backtests kept their profit on the following weeks?

EURUSD 5-minute chart on a trading screen

One of twelve. Here is every rule, tuned on the first two thirds and then run on the last third:

Rule, best stop/targetBacktest, tuning periodDemo fills, tuning periodBacktest, next weeksDemo fills, next weeksTrades
EURUSD EMA 9/21, 15/45-0.02-1.28-0.80-1.86128
EURUSD RSI 14, 10/45+0.92-0.39-0.47-1.6478
EURUSD Bollinger, 30/10+0.63-0.50+0.05-1.02116
EURUSD MACD, 20/45-0.06-0.92+0.27-0.54168
EURUSD Supertrend, 10/45+0.18-0.91-1.15-2.31143
EURUSD Stochastic, 15/30+0.02-1.18-1.06-2.11171
Gold EMA 9/21, $10/$30+1.60+1.78+1.66+1.30111
Gold RSI 14, $15/$15+0.51+0.35-1.39-1.45106
Gold Bollinger, $10/$20+0.70+0.44-0.56-1.12111
Gold MACD, $20/$30+0.99+1.16-0.75-1.07146
Gold Supertrend, $20/$45+0.90+0.62-0.41-0.7180
Gold Stochastic, $30/$20+2.67+2.24-1.11-1.46144

Pips per trade on EURUSD, dollars per trade on gold. “Trades” is the count on the following weeks.

Read the table in two directions. Going across a row, the backtest number shrinks every time something real is added. Going down the “next weeks” columns, the tuning did not carry: settings chosen because they were best on June and July were mostly losers in August, even before costs.

That second loss is the one a demo account is there to catch. The optimizer picks the stop and target that fit the past best, and part of that fit is luck. I measured the same effect on EA settings in my in-sample vs out-of-sample test, where 519 pips in-sample became 4.4 out of sample.

What does a demo account take away that a backtest does not?

I switched the demo conditions on one at a time, on the default 15-pip stop and target over the whole EURUSD sample:

EURUSD, stop 15 / target 15Ideal backtest+ stop wins inside a bar+ next-bar entry+ spread+ slippageTrades
EMA 9/21 cross-0.45-0.45-0.41-1.55-1.59380
RSI 14 30/70-0.21-0.33-0.43-1.49-1.53261
Bollinger 20/20.000.00+0.03-1.10-1.13363
MACD 12/26/9-0.54-0.54-0.33-1.44-1.46515
Supertrend 10/3-1.05-1.05-0.81-1.94-1.98397
Stochastic 14/3/3-0.50-0.55-0.43-1.52-1.56536
Random direction, 100 runs+0.02   -1.141,500 signals

Pips per trade, each column adds one condition to the one before it.

The spread column is where the money goes: 1.10 to 1.14 pips a trade on every rule. Everything else was small. The bar-order question changed at most 0.12 pips, and next-bar entry actually helped four rules by 0.1 to 0.2 pips, because on these bars the next open was on average slightly better than the signal close. Do not count on that; it is small and depends on the data feed. I break the bar-order question down in tick data vs spread.

Notice the last row too. A coin with the same stop and target made +0.02 in the ideal backtest and -1.14 with demo fills. Five of the six rules finished below the coin and Bollinger finished level with it, which matches what I found in rule vs random entry.

What does a demo week feel like on these rules?

EURUSD, demo fills, stop/target 15WeeksGreen weeksBest weekWorst week
EMA 9/21 cross130-0.5-111.1
RSI 14 30/70134+35.3-97.4
Bollinger 20/2134+31.0-100.4
MACD 12/26/9130-10.1-118.4
Supertrend 10/3130-12.3-182.1
Stochastic 14/3/3133+29.0-145.3

Pips per calendar week. First and last weeks are partial.

11 green weeks out of 78. The fade rules (RSI, Bollinger, Stochastic) had a few good weeks, which is exactly the trap: start a demo in the right week and you see +30 pips and think the system works. How many trades a demo needs before it stops lying is in my demo length guide.

Why did gold behave differently?

Because gold’s cost is small next to its moves. A $0.30 spread on bars that move several dollars cost gold 0.3 to 0.4 dollars a trade, so gold rows barely changed between the backtest and demo columns in the tuning period. On gold the damage came almost entirely from the second effect: settings tuned to June and July did not fit August. Stochastic went from the best tuned result (+$2.67) to one of the worst (-$1.46).

The EMA 9/21 cross on gold was the one setup that held: +$1.60 in the tuning period, +$1.30 on the following weeks with demo fills. It was only second-best in the tuning period, which is a pattern worth remembering: the survivor was not the star. It is the same rule that did better on gold than on EURUSD in my gold vs EURUSD test.

So is a demo account worth it after a backtest?

  • Yes, because the backtest will not tell you the second half of the story. 10 of 12 tuned backtests looked profitable; 1 of 12 stayed profitable on the next weeks.
  • Put the spread into the backtest before you open a demo. On EURUSD M5 it was 1.1 pips a trade, bigger than the whole edge of every rule here. With the spread in, all six EURUSD rules lose in the backtest and never need a demo at all.
  • Do not tune on all your data. Keep the last third aside and run the tuned settings there first. That is a free demo of the past.
  • Distrust the best-looking result more, not less. The top in-sample setup on gold was the one that fell furthest.
  • Judge a demo by trade count, not by weeks. A good week on a losing rule was common here: 11 of 78.

If you are building an EA, how to backtest an EA on MT5 covers the tester side, and the position sizing table covers what size to trade once a demo earns it.

Frequently asked questions

Is a backtest or a demo account more accurate?

The demo is closer to live trading because it fills orders with a spread and runs on new data. In this test the backtest overstated results by about 1.1 pips a trade on EURUSD, and settings tuned in the backtest failed on the following weeks in 11 of 12 cases.

Why does my strategy work in the backtest but lose on demo?

Usually two reasons: the backtest had no spread, and the settings were tuned to the past. Here the spread took 1.10 to 1.14 pips per trade, and 10 of 12 setups that were profitable in the tuning period lost afterwards.

Should I backtest before demo trading?

Yes. A backtest with the spread included rejects most rules in minutes. None of the six EURUSD rules here would have reached a demo if the backtest had included the 1-pip spread.

Does next-bar entry make a big difference?

Not on these rules. Entering on the next bar’s open instead of the signal close changed results by -0.10 to +0.24 pips a trade, much less than the spread.

Is demo trading the same as live trading?

No. A demo usually fills without the slippage and requotes of a busy live market, so treat a demo result as the best case for live, not the expected case.

Want a clean indicator to install right now?

It is my own enhanced DeMARK Trend Line indicator for MetaTrader 4 and 5. Non repaint, clean, and free.

Download the Free DeMARK Indicator

Written by Alan Ross

Forex trader and MetaTrader indicator developer. I build and test MT4 and MT5 tools, then write the honest version of how they actually work. More about me.

Last reviewed October 2026
Alan Ross
Alan Ross

Forex educator and indicator developer. I build and trade my own MetaTrader tools, and share the ones that genuinely help.

Leave a comment

Your email address will not be published. Comments are reviewed before they appear.