Skip to content
All library documents

Building Offline Renko and Synthetic Charts in MetaTrader 4

Article MQL5 articles

Summary

This article explains how to create non-standard charts in MetaTrader 4 by generating and updating offline history files with MQL4. Its examples cover an offline chart on a custom period, Renko bricks formed from incoming quotes, and a synthetic USD index assembled from currency-pair data. An indicator attached to an online one-minute chart maintains the history file and refreshes the offline chart; indicators on the offline chart can then display or analyze the generated series.

The method requires handling the history-file header, writing quote records, reopening or updating charts, and accounting for recalculation behavior when offline data changes. The examples illustrate chart construction and platform mechanics rather than demonstrating a profitable trading strategy or validating the synthetic index as a financial product. The article also notes that custom chart creation can be done in MQL4 without DLL calls. Its techniques are specific to MetaTrader 4's offline-chart workflow, and a derived chart's usefulness depends on the transformation rules and source data selected.

Key ideas

  • An MQL4 indicator can create and maintain an offline chart by writing quote records to a history file.
  • A one-minute online chart supplies the base data for constructing custom offline periods.
  • Renko bars can be formed from incoming prices using a chosen brick size.
  • A synthetic USD index can be constructed from multiple currency pairs and displayed as a custom series.
  • Indicators on offline charts must account for recalculation behavior after chart updates.

Tags

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