Skip to content
All library documents

Visualizing Alternative Bars in MetaTrader 5 for Live Calibration

Article MQL5 articles

Summary

The article describes an MQL5 indicator for inspecting ten types of alternative bars as candlesticks in a separate chart window. It reuses the same bar-construction classes as a bar-building expert advisor so that indicator output can be compared directly with bars produced by the advisor or exported for analysis. The viewer accepts real ticks, synthetic ticks expanded from chart OHLC data, or an exported CSV file; tick and OHLC sources can display a forming bar, while CSV contains closed bars only.

Two layouts map alternative bars to the chart: time mode aligns bars with host-chart slots, where multiple bars in a slot overwrite earlier ones, and index mode packs bars sequentially without gaps. Color distinguishes bullish, bearish, and still-forming bars. The article explains that real ticks provide the most faithful construction, while synthetic OHLC ticks are an approximation useful for rapid exploration. It presents the indicator as a calibration and diagnostic aid: unusually flat bars can reveal threshold problems that may be hard to notice in a dense static plot. The supplied text focuses on implementation and visualization, rather than reporting a systematic performance comparison.

Key ideas

  • The indicator renders alternative bars from real ticks, synthetic OHLC ticks, or an EA-generated CSV file.
  • Reusing the EA’s bar-construction classes helps keep the displayed bars consistent with its output.
  • Time mode aligns bars to chart slots, while index mode packs them sequentially for shape comparisons.
  • Bullish, bearish, and forming bars use separate colors to make direction and live status visible.
  • Synthetic ticks provide a quick approximation, while CSV replay omits the state of a forming bar.

Tags

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