Skip to content
All library documents

Measuring How Often Closing Prices Cross a Moving Average

Article MQL5 code base

Summary

The document describes an indicator that measures the percentage of observations in which the closing price is above or below a moving average. Its calculation period matches the averaging period used by the moving average. The moving average is added separately to the main chart for visual comparison; the indicator itself reports the frequency of the close’s position relative to it.

This is a concise description of a price-versus-average statistic, not a complete trading strategy. The document gives no formula details beyond the period relationship, no sample results, and no guidance on interpreting the percentages or using them to generate trades. It also does not specify the instrument, market, or data interval. The measure can summarize how price has related to a chosen average over a window, but the text provides no evidence that it predicts future returns or improves trading decisions.

Key ideas

  • The indicator reports the percentage of observations where the close is above or below a moving average.
  • Its calculation period is set to the moving average’s averaging period.
  • The moving average is displayed on the main chart for visual comparison.
  • The description provides no trading rules or evidence of predictive performance.

Tags

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