OPEN-SOURCE SCRIPT

Unsurpassed Close Levels

52
This indicator identifies and visually highlights previous candle close prices that have not yet been surpassed by any subsequent higher high — creating dynamic horizontal resistance levels based purely on closing prices.
How it works:

For every confirmed candle, a dashed horizontal ray is drawn from its close price extending to the right.
The ray remains visible as long as no future candle's high reaches or exceeds that previous close level.
As soon as price makes a new high that touches or surpasses the level, the ray is automatically removed.
Duplicate levels (exact same close price already active) are skipped to keep the chart clean.
A built-in limit of 50 active levels prevents overload on very long timeframes.

Use cases:

Spot potential resistance zones formed by previous closes that price has failed to reclaim on the upside.
Helpful in downtrends or ranging markets to visualize "overhead supply" levels where sellers previously stepped in at the close.
Great complement to traditional swing highs or supply/demand zones — focuses exclusively on close-based resistance.
Works on any timeframe and any instrument.

Visuals:

Dashed red horizontal rays extending right from unsurpassed closes.
Clean and lightweight — lines disappear automatically when invalidated.

Simple, effective, and fully automatic. No inputs required.
Feel free to customize the color, style, or max levels count in the code if desired.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.