Skip to content
All library documents

Confirming Trends with Consecutive Moving Average Alignment

Article ProRealCode

Summary

This indicator identifies directional trends from the ordering of short and long moving averages. It counts consecutive candles for which the short average remains above the long average, or the long average remains above the short average, and reports a trend only after the count passes a user-selected threshold. Otherwise, it reports no trend. The moving-average periods and the required candle count are adjustable.

The description presents the indicator as a possible scanning input and explains its basic signal logic, but gives no market examples, backtest, or performance evidence. It also contains a code detail that makes the stated downward signal worth checking: the counter decreases while the long average exceeds the short average, and the threshold comparison accounts for that negative count. The method confirms persistent alignment; it does not establish that a trend will continue or specify trade entries, exits, or risk controls.

Key ideas

  • A short average above a long average is treated as upward direction, while the reverse ordering is treated as downward direction.
  • The indicator waits for the ordering to persist for a configurable number of candles before signaling.
  • Users can adjust both moving-average periods and the confirmation threshold.
  • The document proposes using the output for scanning but provides no performance evaluation or trading rules.

Tags

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