Skip to content
All library documents

Displaying Moving Average Values and Bar-to-Bar Changes in MetaTrader

Article MQL5 code base

Summary

This document describes a MetaTrader indicator that displays values from two moving averages across a configurable set of completed bars. It can also show changes between adjacent values, differences between the two series, and selected price marks such as Open, High, Low, or Close. Table colors indicate whether values have risen, fallen, or stayed equal. Users can adjust offsets, rounding, display range, and the table’s appearance.

The indicator updates when a new bar arrives or when its settings, chart timeframe, or symbol change; it does not display the current forming bar by default. This avoids recalculating its table values on every tick, though the author notes that extra code could support tick-based alerts or other calculations. The document explains configuration options and describes code revisions, including an increased limit for the moving average period. It offers no trading rules, performance evidence, or backtest results, so the indicator is best understood as a display and monitoring aid rather than a validated strategy.

Key ideas

  • The indicator presents two moving averages and their sequential changes for completed bars.
  • It can display price marks such as Open, High, Low, or Close instead of moving averages.
  • Cell colors distinguish rising, falling, and unchanged values.
  • Offsets, decimal rounding, the displayed range, and table styling are configurable.
  • The default table avoids the current forming bar and updates on new bars or chart changes.

Tags

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