Skip to content
All library documents

Measuring Consecutive Higher Highs and Lower Lows

Article ProRealCode

Summary

This short indicator description counts consecutive bars in which the high is at least as high as the previous bar's high, and consecutive bars in which the low is at most the previous bar's low. Each count resets to zero when its respective comparison fails. It also calculates a moving average of each count over a configurable lookback period, with the example using a period of twenty bars.

The output plots the high and low streaks alongside their averages, giving a compact way to observe persistence in upward or downward extremes. The document provides indicator code but no rules for entering or exiting trades, parameter study, or performance evidence. The measure can describe recent price behavior, but by itself does not distinguish a durable trend from noisy movement or indicate how to manage risk. It is best understood as a descriptive technical indicator that would need a separate strategy and evaluation before trading use.

Key ideas

  • The indicator tracks streaks of bars making nondecreasing highs and nonincreasing lows.
  • Each streak counter resets when its corresponding comparison condition fails.
  • Moving averages of the counters provide a smoothed view of recent streak lengths.
  • The indicator describes price behavior but supplies no standalone entry, exit, or risk rules.
  • No backtest or evidence of trading performance is presented.

Tags

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