Skip to content
All library documents

Building Offline MQL4 Charts with the Updated History Format

Article MQL5 articles

Summary

The article explains how legacy and updated MQL4 tools create and update offline charts from standard chart data. Its example uses a period-conversion script on EURUSD one-minute bars to generate custom two-, three-, or four-minute history, which is then opened through MetaTrader’s offline chart menu. The converter continues processing incoming ticks and periodically sends updates to the custom chart.

For compiling older source with the newer language version, the article highlights two adjustments: specify shared read and write access when opening the history file, and avoid flushing the file after every bar because immediate disk writes can slow generation. The newer built-in converter instead stores bar fields through the MqlRates structure. The account is a software workflow description, not a trading strategy or performance study; it offers no evidence that nonstandard periods improve trading results.

Key ideas

  • Legacy compiled MQL4 programs remain usable in the updated terminal, according to the article.
  • A period converter can aggregate standard chart history into custom offline timeframes and keep them updated from incoming ticks.
  • Newer MQL4 code must explicitly request shared file access when the history file also needs to be opened as a chart.
  • Frequent file flushes can slow history generation because the updated function writes data to disk immediately.
  • The built-in converter uses MqlRates to store time, price, volume, and spread fields.

Tags

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