Skip to content
All library documents

Deviation Oscillator: Normalizing Price Distance from a Moving Average

Article MQL5 code base

Summary

The Deviation Oscillator is presented as a volatility-oriented indicator that measures the distance between an applied price and its moving average, then scales that distance using the minimum and maximum deviations observed over a selected range. The result is normalized to a bounded scale based on the range extrema, with a central offset. This makes the indicator a way to view price displacement relative to its recent deviation history.

The inputs are the moving-average period, the lookback range for normalization, the moving-average calculation method, and the applied price. The note defines the deviation as applied price minus its moving average and derives the scaling factor from the difference between the maximum and minimum deviations. It gives no trading rules, parameter guidance, performance tests, or discussion of behavior when the extrema coincide. The description therefore explains an indicator calculation rather than establishing a standalone trading strategy or a tested source of signals.

Key ideas

  • The oscillator starts with the difference between an applied price and its moving average.
  • It rescales that deviation using the minimum and maximum values over a selected lookback range.
  • Its inputs control the moving-average period, normalization range, calculation method, and applied price.
  • The note explains the calculation but supplies no trading rules or performance evidence.

Tags

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