Skip to content
All library documents

Using 9- and 21-Period EMA Crossovers with Historical Range Targets

Article ProRealCode

Summary

This indicator pairs 9- and 21-period exponential moving averages with crossover markers and a color-coded view of price relative to both averages. When price is above both averages, it marks bullish sentiment; when below both, bearish sentiment; and otherwise it shows a neutral state. Arrows identify upward and downward EMA crosses.

The target levels are estimated from historical prices in a rolling lookback: the script compares the average price at prior crosses with the highest or lowest closes observed while price stayed on the corresponding side of both averages. It uses half and full differences from those averages to project two levels from the opening price at a new cross. ATR is used to offset the arrows, rather than to calculate the target distances, despite the document’s brief description. No testing results are provided. The method’s usefulness depends on the lookback and history available, and historical ranges do not establish how far a future move will travel.

Key ideas

  • The indicator marks crosses between 9- and 21-period exponential moving averages.
  • Price relative to both averages determines whether the display signals bullish, bearish, or neutral sentiment.
  • Projected levels use historical highs or lows relative to average crossover prices, then apply half and full range differences.
  • ATR offsets the crossover arrows on the chart but does not determine the projected target distances.
  • The document provides no backtest evidence that these historical range estimates predict future moves.

Tags

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