Skip to content
All library documents

Exporting Chart OHLCV History from MetaTrader 5 to CSV

Article MQL5 code base

Summary

The document describes a utility for saving the historical OHLCV data available on a MetaTrader 5 chart to a CSV file in the platform’s common data directory. It is presented as an alternative when the standard Symbols request tool fails to return all history visible on the chart. The key setup requirement is to set the chart’s maximum bar count to unlimited so the chart can load the available history before export.

This is a data collection procedure rather than a trading method: it does not explain the script’s implementation, show a sample file, or discuss data cleaning and validation. The amount of history exported depends on what the chart has loaded and what the platform makes available, so exporting does not by itself establish that the resulting series is complete or suitable for research. The document offers no strategy test or market-performance evidence.

Key ideas

  • A script can export the OHLCV history available on a MetaTrader 5 chart to a CSV file.
  • The export is suggested when the standard history request tool omits data visible on the chart.
  • The chart’s maximum bar setting should be unlimited before attempting to load and save history.
  • The document does not provide the script itself or explain how to validate the exported data.

Tags

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