OPEN-SOURCE SCRIPT
Dynamic Pivot Confluence Levels

Dynamic Pivot Confluence Levels – Visible Range
This indicator automatically detects the strongest price levels in your currently visible chart area by counting how many swing highs (maxima) and swing lows (minima) have occurred at or near the same price.
It draws one or two horizontal lines at the level(s) with the highest total number of turning points, helping you quickly identify high-probability support and resistance zones based on real market turning points rather than arbitrary calculations.
The indicator is fully dynamic — it recalculates automatically whenever you zoom or scroll the chart.
How it works
Detects swing highs and swing lows using a configurable pivot strength (left/right bars).
Groups nearby pivot prices into buckets so that small price differences are treated as the same level.
Counts the combined number of swing highs + swing lows in each price bucket within the visible chart range only.
Draws horizontal line(s) at the strongest level(s):
Single strongest level → Blue line
Multiple levels with the exact same highest count → Green line (higher price) + Red line (lower price)
Optional labels on the right side show the price and the number of pivots that formed the level (a measure of its strength).
Usage Tips
Works well on timeframes from 5 minutes to daily.
Zoom in for more localized, short-term levels. Zoom out to see broader, higher-timeframe confluence zones.
On highly volatile instruments (e.g. crypto) or lower timeframes, increase Group Ticks to avoid too many fragmented levels.
The lines and labels only consider pivots inside your current visible range. This makes the indicator very responsive to what you are actually looking at.
If you receive a runtime error (RE10045), reduce the Max Lookback Bars value (e.g. to 300 or 250).
The number shown in the label represents how many turning points (swing highs + swing lows) occurred at that level — higher numbers indicate stronger confluence.
Notes
This indicator is designed to highlight confluence zones where many market participants have previously changed direction. It does not repaint and only uses confirmed pivots within the visible chart window.
This indicator automatically detects the strongest price levels in your currently visible chart area by counting how many swing highs (maxima) and swing lows (minima) have occurred at or near the same price.
It draws one or two horizontal lines at the level(s) with the highest total number of turning points, helping you quickly identify high-probability support and resistance zones based on real market turning points rather than arbitrary calculations.
The indicator is fully dynamic — it recalculates automatically whenever you zoom or scroll the chart.
How it works
Detects swing highs and swing lows using a configurable pivot strength (left/right bars).
Groups nearby pivot prices into buckets so that small price differences are treated as the same level.
Counts the combined number of swing highs + swing lows in each price bucket within the visible chart range only.
Draws horizontal line(s) at the strongest level(s):
Single strongest level → Blue line
Multiple levels with the exact same highest count → Green line (higher price) + Red line (lower price)
Optional labels on the right side show the price and the number of pivots that formed the level (a measure of its strength).
Usage Tips
Works well on timeframes from 5 minutes to daily.
Zoom in for more localized, short-term levels. Zoom out to see broader, higher-timeframe confluence zones.
On highly volatile instruments (e.g. crypto) or lower timeframes, increase Group Ticks to avoid too many fragmented levels.
The lines and labels only consider pivots inside your current visible range. This makes the indicator very responsive to what you are actually looking at.
If you receive a runtime error (RE10045), reduce the Max Lookback Bars value (e.g. to 300 or 250).
The number shown in the label represents how many turning points (swing highs + swing lows) occurred at that level — higher numbers indicate stronger confluence.
Notes
This indicator is designed to highlight confluence zones where many market participants have previously changed direction. It does not repaint and only uses confirmed pivots within the visible chart window.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。