Advertisement IC Markets

Roundup: Honest backtests for scalping EAs, costs, tick data, look-ahead and repainting

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
Fairman
Posts: 6955
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Roundup: Honest backtests for scalping EAs, costs, tick data, look-ahead and repainting

Post by Fairman »

Roundup: Honest backtests for scalping EAs, costs, tick data, look-ahead and repainting

The algo board has a run of threads on why backtests lie, each covering one cause. Read together they make a decent pre-flight checklist for any scalping EA test, so here's the combined version.

Costs first

The "backtests without spreads are fiction" thread does the maths that matters. A strategy trading 10 times a day for 1.5 pips gross, with 1.2 pips of spread plus commission, nets 0.3 pips a trade. A small error in the cost assumption flips that from a profit to a loss. A reply suggests logging the spread at each live entry for a few weeks so the test uses your real average cost, not a guess.

The EURUSD M1 honesty thread lists the minimum: session-aware variable spread, slippage scenarios rather than zero, rejecting trades when spread exceeds your live cap, and out-of-sample and walk-forward testing on top.

Slippage assumptions

The slippage distributions thread compares three options. Fixed, like 0.2 pips on every fill, is simple and unrealistic. Random from a distribution is better. Empirical, sampled from your own live fills by time and order type, is the most realistic if you have the data. Stops slip more than market entries, and news minutes much more, so one number for everything flatters stop-heavy strategies.

Tick data vs bar data

Two threads cover this. The every-tick vs real-ticks thread explains the MT5 tester modes: "Every tick" generates synthetic ticks from M1 bars, so the price path inside each minute is invented, while "Every tick based on real ticks" replays the broker's recorded ticks with their actual spreads. For scalping EAs that can change results completely. A reply in the M1 honesty thread calls real ticks the least-guesswork option for the spread side.

The tick vs bar thread adds the bar ambiguity problem: if a candle's range contains both your stop and target, bar data can't tell you which came first. A reply suggests turning on a worst-case setting where available. Another notes news minutes are where the two data types disagree most, because real ticks show gaps and frozen quotes that bars smooth over. And if the tester reports low modelling quality, don't argue with it.

Look-ahead bias

The look-ahead thread gives the classic example: using the day's high or low in a rule for an intraday entry. At 10am you don't know the final high. The replies add a sneakier one: using the close of a higher timeframe candle to filter a lower timeframe entry while that candle is still forming. For manual testing, bar replay is the closest thing to not knowing what comes next.

Repainting in multi-timeframe filters

The MTF repainting thread is that sneakier case in practice. An M15 moving average filter on an M5 EA made the backtest much better, because the EA was reading the current, unfinished M15 bar. The fix is reading from the last closed bar, and a reply extends that to anything from a higher timeframe: highs, lows and candle direction too. Another checks the tester actually has complete higher timeframe history for the test dates.

The line from that thread worth pinning above any optimisation run: if one simple filter transforms a backtest, suspect a bug before you believe in an edge.

Where people differ

Mostly on how far to go. Real ticks plus empirical slippage is the gold standard, but it needs data many people don't have. The minimum everyone agrees on is variable spread and a slippage assumption above zero.

What's the biggest gap you've seen between an EA's backtest and its first month live, and what turned out to cause it?

Threads this pulls from
It’s Fairman :geek:
Recommended broker for automated trading & scalping IC Markets
FXS Prop Desk
Posts: 1689
Joined: Wed Oct 07, 2026 9:52 am

Re: Roundup: Honest backtests for scalping EAs, costs, tick data, look-ahead and repainting

Post by FXS Prop Desk »

The spread maths is the first step most tests skip. Another one to add: variable spread in the test should come from real historical spreads, not a fixed average. A strategy that trades mostly around the London open or rollover will meet much higher spreads than average, and a fixed spread hides that.

Repainting deserves a simple check: run the indicator on live data for a week, take screenshots at each signal, then compare with how the chart looks after the fact. Any signal that moved or disappeared is a warning sign for the backtest.
FXS Official Team | The Idea Lab & Strategy
Shadow Trader
Posts: 5594
Joined: Wed Sep 09, 2026 5:19 pm

Re: Roundup: Honest backtests for scalping EAs, costs, tick data, look-ahead and repainting

Post by Shadow Trader »

Tick data doesn't come from a central source. Each broker, bank, and data vendor records its own stream. The same moment can look slightly different in each.

Broker history shows what that broker's feed delivered. It includes the broker's spread markup and filtering. Testing against it models that broker's pricing but misses the quirks of others.

Vendor data, from providers that aggregate liquidity from several banks, is usually cleaner and shows the market's best prices. But it doesn't include the broker's markup, so spreads look tighter than they'd be live.

Bank data, from a single liquidity provider, reflects that bank's quotes alone.

For a realistic test, the closest source to the live feed is best: the same broker's data, or failing that, vendor data with a spread model that matches the broker's average. A mismatch inflates results.

Some traders record their own tick data for months, directly from the live platform, giving a perfect match for execution conditions. It requires storage and patience but produces the most trustworthy results.

Which tick source has matched live results best on the pairs traded here?
Post Reply