Page 1 of 2

Spotting a stale price feed from inside an EA

Posted: Wed Oct 21, 2026 1:17 pm
by Fairman
Spotting a stale price feed from inside an EA

An EA can be running, the terminal can show connected, and the prices can still be stale. The last quote arrived a while ago and nothing new has come in, but the EA keeps working with the old bid and ask as if they were current.

This is different from a frozen EA. The code is fine. The data isn't.

A simple check is to compare the time of the last tick with the current server or local time. In MQL5 you can read the time of the last tick through SymbolInfoTick and compare it with TimeCurrent or TimeLocal. If the gap is larger than you'd expect for that pair and session, treat the price as stale and don't send new orders based on it.

What counts as too old depends on the session. During London a gap of more than a few seconds on EURUSD is unusual. In the late Asian hours a gap of twenty or thirty seconds can be normal. A single fixed threshold for the whole day will either be too strict at night or too loose in the morning, so it makes sense to set it per session.

It also helps to check more than one symbol. If every symbol is stale at the same moment, the problem is the connection or the broker server. If only one is stale, it may just be a quiet market on that pair.

When the check fails, the EA shouldn't try to fix anything. Log it, stop opening trades, and alert you. Managing existing stops is the broker's job as long as they're server side.

Re: Spotting a stale price feed from inside an EA

Posted: Sat Oct 24, 2026 6:24 pm
by Fairman
Testing this logic is awkward, because stale feeds don't happen on demand. One way is to run the EA on a demo account and disconnect the network briefly while watching the log. Another is to add a debug input that forces the staleness check to report true, so you can see that the rest of the code responds correctly. Without some kind of deliberate test, it's easy to write the check and only find out it doesn't work properly when it matters, which is usually in the middle of a live session with real positions open and the broker having a bad day.

Re: Spotting a stale price feed from inside an EA

Posted: Sat Oct 24, 2026 6:42 pm
by Fairman
Weekends and the daily break will trigger a naive staleness check every time. The market isn't open, so of course there are no new ticks. The check should only run during the symbol's trading session, using the session times the platform provides for each symbol, otherwise the EA will flood your phone with alerts every Saturday morning. Pulling the session times from the symbol info at runtime, rather than hard coding them, also means the check keeps working correctly if the broker changes its hours around a holiday or a daylight saving shift. Pull the session times for the specific symbol, since metals and indices often differ from FX.

Re: Spotting a stale price feed from inside an EA

Posted: Sat Oct 24, 2026 8:01 pm
by Fairman
Logging the tick gaps over time gives you a useful dataset. If you record the longest gap between ticks in each hour, you'll quickly see what normal looks like on your broker for each pair. That gives you sensible thresholds instead of guesses. It also shows if the feed quality changes over time, for example after a broker announces new liquidity arrangements or server moves. The log doesn't need to be large, one line per hour per symbol is enough, and it can be written to a plain CSV file that's easy to open later in a spreadsheet or a short Python script.

Re: Spotting a stale price feed from inside an EA

Posted: Sun Oct 25, 2026 8:14 am
by Fairman
There's a related problem with a feed that isn't stale but is wrong. A single spike tick far from the real price, which arrives and then disappears, can trigger stop logic or entry logic in an EA. Some developers add a simple sanity check that ignores any tick more than a certain number of ATR away from the previous one, at least for entry decisions. That won't catch everything, but it reduces the chance of an EA opening a trade on a quote that the rest of the market never actually saw, which is the kind of loss that's very hard to explain afterwards. Treat that check as a guard on new entries only, so it never blocks the EA from closing a position.

Re: Spotting a stale price feed from inside an EA

Posted: Sun Oct 25, 2026 1:02 pm
by FXS London Scalper
Checking the age of the last tick is the right approach. One addition: the acceptable age should depend on the session. During London a gap of 30 seconds without a tick on EURUSD is unusual and worth flagging. At 23:00 London it can be normal. A fixed threshold either fires too often at night or misses problems in the busy hours. A threshold based on the time of day, or on the average tick rate of the last hour, works better.

Re: Spotting a stale price feed from inside an EA

Posted: Sun Oct 25, 2026 2:44 pm
by GrahamW1972
had this exact thing a couple of years back. i set a flat 10 second limit on teh check and went off to the pub quiz feeling very pleased with myself... got home to about forty alerts on my phone, all from half eleven onwards, and EURUSD was just ticking along every twenty odd seconds like nowt was wrong. the EA had done exactly what i told it, which was bloody nothing, so to be fair it was me being thick. spent most of sunday in the garage with the laptop balanced on the Defender's bonnet and a brew going cold, and the missus thought the whole thing was hilarious.

Re: Spotting a stale price feed from inside an EA

Posted: Wed Oct 28, 2026 11:34 pm
by FXS Prop Desk
GrahamW1972, the pub quiz story is the classic flat-timeout trap. Late in the evening EURUSD can quite normally go twenty or thirty seconds without a tick, so a fixed ten second limit becomes an alarm clock. A more robust check scales with the hour: record the typical gap between ticks for each hour of the day over a few weeks, and only flag the feed when the current silence is several times that typical value. Pairing it with a second symbol from the same server also helps tell a dead feed from a quiet market.

Re: Spotting a stale price feed from inside an EA

Posted: Thu Oct 29, 2026 12:52 pm
by GrahamW1972
FXS Prop Desk wrote:GrahamW1972, the pub quiz story is the classic flat-timeout trap. Late in the evening EURUSD can quite normally go twenty or thirty seconds without a tick, so a fixed ten second limit becomes an alarm clock.
reckon the hourly baseline is what i ended up with, bar one tweak... i log the longest gap per hour into a csv and set the limit at about three times the worst gap from the last few weeks, not the average. average got me a couple of false alarms around the rollover, which is bloody typically when you least want them. second symbol check is definately worth it too, i use GBPUSD as the nosy neighbour 🙂

Re: Spotting a stale price feed from inside an EA

Posted: Sat Oct 31, 2026 11:47 am
by Shadow Trader
Two wicks can look identical on a one-minute chart and mean completely different things. One is a genuine fast move that traded. The other is a single bad or stale quote that printed once and vanished.

A stale quote happens when one source keeps sending an old price while the rest of the market has moved on, or when a feed hiccups and a quote briefly arrives out of sequence. If the aggregator accepts it into the stream for one tick, the chart draws a needle.

How to tell them apart, roughly:

- A real wick has several ticks inside it, with price traveling through the range. A stale one is often a single tick in and a single tick out.
- A real wick shows up on other symbols tied to the same currency. A stale one usually stays on one pair.
- A real wick is visible on more than one broker. A bad quote tends to live on one feed only.
- A real wick comes with the spread widening and volume rising. A bad quote often leaves both normal.

The difference matters twice. For signal logic, a stale wick can set off an indicator or distort a level that did not really exist. For fills, orders touching that tick may be rejected, requoted, or later disputed, and outcomes vary by broker policy.

A practical filter for systems is ignoring any bar extreme formed by a single tick, or confirming against a second source.

How do you handle single-tick wicks when marking levels, and do you ever trust them?