Skip to content
All library documents

Adding Indicator Warm-Up History to a Market Replay System

Article MQL5 articles

Summary

This article explains how to add earlier price history to a tick-based market replay so indicators have enough data to produce useful values when replay begins. It estimates the required warm-up bars from the largest indicator period and the longest chart timeframe under study, then estimates how many trading days are needed based on the instrument’s session length. Examples cover a long moving average on a five-minute chart and a set of indicators used across several timeframes.

The implementation loads prior one-minute bars alongside the tick file, allowing MetaTrader 5 to build other chart periods from that history. A replay-position adjustment removes bars generated by replayed ticks while retaining the earlier bars as context. The discussion notes that trading hours, auctions, and market-specific sessions affect the history required, so bar and day estimates are approximations. It focuses on replay setup rather than trading signals or performance, and the described implementation is a stage in a larger system.

Key ideas

  • Indicators need sufficient prior bars to produce useful values at the start of replay.
  • Estimate warm-up history from the longest indicator period and the longest chart timeframe used.
  • Trading sessions and interruptions affect how many days are needed to obtain the target bar count.
  • One-minute historical bars let the platform construct other chart timeframes for replay.
  • The article describes replay infrastructure and provides no evidence about trading performance.

Tags

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