All indicators

Counting Support & Resistance Levels

Dec 1, 2020

Static chart image
Support and ResistancePivot Based (Retrospective)

The Counting Support & Resistance Levels indicator identifies and tracks pivot-based price levels, counting the progression of highs and lows to help traders identify trend exhaustion or strength. It provides a visual framework for understanding price action by plotting dynamic support and resistance lines based on user-defined pivot lookback periods.

Usage

The tool is primarily used to identify established price floors and ceilings. When the price creates a new pivot high, a resistance line is plotted; conversely, when a pivot low is formed, a support line is displayed.

Traders can use this tool to:

  • Identify potential breakout or reversal zones.
  • Track the frequency of higher highs (HHs) and lower lows (LLs) to gauge market momentum.
  • Set alerts for when the market establishes a new structural level.

The indicator allows for two calculation methods: using the high/low of the bars for a more "wick-based" structural view, or using the close for a "body-based" trend view.

Details

The script utilizes the ta.pivothigh and ta.pivotlow functions to detect structural turning points. A pivot is confirmed only after a specific number of bars have passed to the left and right of the peak or trough. This ensures that the identified level is a genuine local extremum. The levels are then projected forward until a new pivot is detected, creating the stepped line appearance common in support and resistance analysis.

Settings

  • Left Bars: The number of bars required to the left of a high or low to qualify it as a pivot.
  • Right Bars: The number of bars required to the right of a high or low to confirm it as a pivot (this introduces a lag equal to the input value).
  • Method H/L=TRUE Cl=FALSE: Determines if the pivots are calculated based on the bar's High/Low prices (True) or the Closing prices (False).
  • Target # of HHs: The specific count of higher highs used for internal logic and tracking.
  • Target # of LLs: The specific count of lower lows used for internal logic and tracking.

FAQ

How do I use the "Method" toggle?

If you want to find levels based on the absolute extremes of price (wicks), keep the Method checked (True). If you prefer levels based on where the price settled, uncheck it (False) to use Closing prices.

Why do the lines appear with a delay?

The lines appear after the "Right Bars" count is met. This is necessary to confirm that the high or low was indeed a pivot point and not just a temporary fluctuation.

How can I access the Counting Support & Resistance Levels tool?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.