Skip to content
All library documents

Detecting Out-of-Order Price Ticks in MetaTrader

Article MQL5 code base

Summary

The document explains a monitoring method for identifying stale or delayed quotes in an automated trading setup. For each incoming tick, the detector compares its timestamp with the previous tick’s timestamp and records an alert when the new tick is earlier. Alerts can be sent through a pop-up, email, or a separate log that includes the instrument and recent bid, ask, and timestamp details. The author also cautions that platform logs use local computer time while quote timestamps use the platform’s market time.

The article says occasional out-of-order ticks may have legitimate causes. Frequent incidents could indicate a broker-side feed issue, but the document does not establish manipulation as the cause. It recommends considering other execution symptoms, terminal-to-server latency, and internet quality when investigating. This is a feed-monitoring diagnostic, not a trading signal, and no measured detection accuracy or market-performance results are presented.

Key ideas

  • Compare each tick’s timestamp with the preceding tick to detect out-of-order quotes.
  • Record the instrument and relevant bid, ask, and timestamp information when an alert occurs.
  • Account for the difference between local computer time and the platform’s market time in logs.
  • Investigate recurring alerts alongside execution behavior, server latency, and connection quality.
  • An alert can indicate a feed problem but does not by itself prove intentional manipulation.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.