Skip to content
All library documents

Detecting Maximum Price Deviation from a Moving Average

Article MQL5 code base

Summary

MaDev is an indicator concept for locating the greatest deviation between price and a moving average. It divides observations into frames and searches within each frame for the maximum deviation, marking that point with a signal pointer. The description compares the frame-based search to finding fractal-like extrema, so the output highlights local peaks in the distance between price and its average.

The indicator exposes four settings: the moving-average period, calculation method, applied price, and frame size. These choices determine the underlying average and the span over which an extreme deviation is selected. The document explains the indicator's mechanics but gives no entry or exit rules, market-specific guidance, performance results, or evidence that extreme deviations predict reversals or continuation. It should therefore be read as a technical measurement tool rather than a complete trading strategy.

Key ideas

  • The indicator measures price deviation from a moving average.
  • It searches each frame for the largest deviation and marks that observation.
  • The moving average period, method, applied price, and frame size control the calculation.
  • The description does not establish whether marked deviations predict profitable trades.

Tags

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