Skip to content
All library documents

A Moving Average Trend Oscillator from Multiple Periods

Article MQL5 code base

Summary

The MA Trend oscillator estimates directional bias by comparing an applied price with a range of moving averages. Users choose a starting period, period increment, count of averages, averaging method, and applied price. For each average, the calculation assigns a positive score when price is above it and a negative score when price is below it, then averages those scores. The output therefore summarizes how many averages place price on either side, rather than measuring the distance between price and the averages.

The document illustrates two parameter configurations, one using evenly spaced periods and another using smaller increments, but provides no performance results or trading rules. Its value is as a trend-measurement indicator that can aggregate signals across several horizons. The output depends on the selected period range, method, and price input, and the description does not specify how equality or missing values are handled. It should not be read as evidence that the indicator predicts future returns.

Key ideas

  • The oscillator compares an applied price with several moving averages of different periods.
  • Each comparison contributes a positive score above the average or a negative score below it.
  • The final value is the mean of those directional scores.
  • Starting period, increment, count, averaging method, and applied price shape the indicator.
  • The document gives parameter examples but no validated 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.