Skip to content
All library documents

Displaying Moving Average Values, Price Distances, and Sequential Changes

Article MQL5 code base

Summary

This indicator displays a table of moving-average values across earlier bars, along with sequential value changes and distances in points. Its inputs allow users to compare moving averages with one another or with bar prices such as open, high, low, and close. It also supports positive or negative offsets, decimal rounding or added precision, configurable table dimensions and appearance, and optional indicator lines. Colors distinguish rising, falling, and unchanged values in supported rows.

The table updates when a new bar appears or when the user changes its settings, symbol, or timeframe. It deliberately excludes the current forming bar, whose values can change on every tick; alerts based on current-bar values would require additional implementation. The document explains that apparent differences from platform moving averages can result from display precision and rounding, and suggests checking the data window or increasing displayed decimal digits. It offers no trading signals, performance tests, or strategy evaluation.

Key ideas

  • The table shows moving-average values for earlier bars, sequential changes, and point distances.
  • Users can configure comparisons against bar prices or other moving averages, with offsets and precision settings.
  • Display colors indicate increases, decreases, and unchanged values in supported rows.
  • The current forming bar is excluded from the table, though extra code could support alerts using it.
  • Displayed line mismatches can reflect rounding or decimal precision rather than calculation errors.

Tags

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