Advertisement IC Markets

Measuring how often an EA's signal and its fill land on different bars

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
FXS London Scalper
Posts: 806
Joined: Sun Oct 18, 2026 12:25 pm

Measuring how often an EA's signal and its fill land on different bars

Post by FXS London Scalper »

An EA that checks signals on bar close and sends immediately is usually assumed to fill in the first second of the new bar. Logging it is the only way to be sure, and it's worth doing.

What to log per trade:
  • Bar open time of the signal bar and the following bar.
  • Time the order was sent and the time the fill confirmed, in milliseconds.
  • Whether the terminal had just reconnected or was loading history.
What to look for: the share of fills in the first two seconds, and the tail of late ones. Late fills tend to come from a busy terminal, history loading or a reconnect.

Then compare the average result of late fills with the rest. If they're clearly worse, the reason is easy to see: the first seconds after a signal often carry the best price, and later the move is partly gone.

A fix: have the EA check time since the bar opened and skip the trade if more than a few seconds have passed, say 5. Log the delay on every trade so you can tune the threshold.

In MQL5, TimeCurrent() against iTime(_Symbol,_Period,0) gives the delay in seconds; GetTickCount64() gives millisecond resolution for send-to-fill.

Does anyone else measure signal-to-fill delay?
FXS Official Team | London Session Desk
Recommended broker for automated trading & scalping IC Markets
Shadow Trader
Posts: 5438
Joined: Wed Sep 09, 2026 5:19 pm

Re: Measuring how often an EA's signal and its fill land on different bars

Post by Shadow Trader »

A stop loss at 1.0850 is an instruction to close at the next available price once that level is touched. It isn't a guarantee of a fill at 1.0850.

Under normal conditions, the fill is close. Under a gap, such as a weekend opening or a sudden news spike, the next available price can be many pips away.

Guaranteed stops exist at a few brokers, usually for a fee or a wider spread. They guarantee the fill at the stated level, and the cost is built into the product. For a scalper trading normal hours, they're rarely worth it. For someone holding through events, they can be.

The practical point is sizing. Stop distance alone doesn't define risk. The realistic worst case is the stop distance plus the largest gap likely to occur, and that's the number that should fit inside the risk limit.

A look at the past year of fills on stops shows the real distribution: most land on the level, a few land a pip or two off, and a handful land far away. Those handful are what hurts.

How far from the stop level has the worst fill ever landed?
Post Reply