Skip to content
All library documents

Maintaining Bar-Time Estimates During Low-Liquidity Replay

Article MQL5 articles

Summary

This installment explains how a market replay service supplies elapsed-time information to a chart indicator when low liquidity interrupts the usual calculation events. The service encodes time-related values in custom rate data and updates replay ticks and bars. When a real tick arrives, its timestamp resets the estimate; between ticks, timer events advance the stored value by one second. The indicator can therefore continue to show an approximate remaining time within the bar even when market updates are sparse.

The article’s key operational detail is that the timer estimate need not match real time exactly: it may lead or lag during a long gap, then correct itself on the next real tick. The author also describes pausing and resuming replay as a way to skip waiting through illiquid periods. This is a narrow implementation discussion for a MetaTrader replay and indicator system, not a trading signal or a method for forecasting liquidity. The treatment of auction states is deferred to a later installment.

Key ideas

  • Sparse ticks can prevent a chart indicator from receiving regular calculation events for elapsed-time updates.
  • The replay service advances its time estimate between real ticks using timer events.
  • Incoming real ticks reset the estimate to match their timestamp, so the interim value can be approximate.
  • Pausing and resuming replay can skip long waits during periods without ticks.
  • The method concerns replay display timing and does not estimate market direction or trading opportunity.

Tags

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