Skip to content
All library documents

Correcting Tick Timing and Generating Ticks in a Market Replay

Article MQL5 articles

Summary

This installment of a MetaTrader 5 replay-system series addresses timing errors in one-minute bar creation and improves how replay ticks reach Market Watch. It moves timestamp construction to the tick-file loading stage, then uses the stored timestamp when adding each tick. The article also describes pacing replay from differences between successive tick times, while checking playback state and stop conditions around pauses.

A further change adjusts randomized tick generation so the simulator can sometimes produce direct orders. The evidence is implementation guidance and a comparison the author invites readers to make by viewing real-tick replay and simulated data in Market Watch. The article does not provide quantitative performance results, and the supplied excerpt is incomplete around the explanation of pause behavior. It also cautions that the replay system is still under development and is not yet suitable for every type of trading system.

Key ideas

  • Construct tick timestamps during file loading so bar creation and chart updates use consistent time values.
  • Use the elapsed time between ticks to pace replay and periodically update playback controls.
  • Check stop and playback state around pauses so replay can respond to user controls.
  • Adjust randomized spread generation to allow occasional direct orders in the simulation.
  • The replay system remains an evolving tool, and the article provides no quantitative validation.

Tags

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