Skip to content
All library documents

Checking Available Bars and CopyRates Data in MetaTrader

Article MQL5 code base

Summary

This utility explains how to inspect historical bar data for a selected market symbol across chart timeframes. It displays synchronization status, the number of bars available, and the date of the oldest bar, using the terminal’s series information functions. It also checks whether CopyRates can retrieve data for a chosen bar index, defaulting to the oldest bar reported for each timeframe.

The document describes controls for choosing a symbol and bar number, moving the display, and enabling error logging. It reports that the terminal may list bars that CopyRates cannot retrieve, including in the author’s testing when the series count exceeded 100,000 while retrieval failed above bar index 99,999. These observations are specific to the terminal version tested and are not a general performance benchmark. The utility is for diagnosing historical data availability; it does not provide trading signals or market analysis.

Key ideas

  • The utility reports synchronization, bar count, and oldest-bar date for each timeframe.
  • CopyRates retrieval can be checked for a selected valid bar index.
  • The author observed that reported series history could exceed the range CopyRates retrieved in testing.
  • Users can select a Market Watch symbol and toggle error logging.

Tags

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