Skip to content
All library documents

Creating a Custom Chart Period from Standard Bars

Article MQL5 code base

Summary

This guide explains how to create a non-standard chart period by aggregating a standard period in MetaTrader. Its example creates an H3 chart from H1 data: the user attaches a period conversion script to an H1 chart, sets the multiplier to three, and opens the resulting H3 chart in offline mode. While the source chart remains open with the script attached, the custom chart refreshes periodically, with a default update interval of two seconds.

The material is a platform procedure rather than a trading strategy or evidence of trading performance. It explains how to make a chart timeframe available, but does not describe how to validate the aggregated bars, handle missing data, or use the custom period in a backtest. The workflow also requires enabling DLL imports in the script settings. The description does not evaluate the reliability of that configuration or compare the resulting bars with native timeframe data.

Key ideas

  • A period conversion script can build a non-standard chart period from a standard chart period.
  • Setting the multiplier to three on an H1 chart is described as producing an H3 chart.
  • The generated chart is opened in offline mode and updates while the source chart and script remain active.
  • The stated default refresh interval is two seconds.
  • The procedure requires enabling DLL imports in the script settings.

Tags

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