Pivot Cluster Support Resistance Zones

An adaptive S/R tool that turns recent pivots into clean, readable zones with optional trade setup guidance and midline cross alerts.
What the script shows on your chart
It draws shaded price zones that act as support or resistance based on where the zone midpoint sits relative to the current close. Zones above price are tinted as resistance and zones below price are tinted as support. Each zone carries a compact label that prints the current timeframe plus the exact mid price, for example “4H | 4325.25”. When you enable trade setups, the script adds labels for an entry at the nearest zone midpoint, a stop placed just outside the zone with a volatility aware buffer, and one or more take profit points at the next zone midpoints in the path of the move. The script also exposes three alert conditions that trigger when price crosses a zone midpoint upward, downward, or either way.
How to use it if you are new to TradingView or price action
Apply the indicator to a clean chart first so the shaded boxes and labels are easy to read. Green tinted boxes are support areas that can catch pullbacks when price trades above them. Red tinted boxes are resistance areas that can cap rallies when price trades below them. Start by watching how price reacts when it approaches the nearest zone. If you enable the trade setup option, use the “Entry” label as a suggested fair value inside the nearest zone, place the “Stop Loss” just beyond the zone using the automatic buffer shown in the label, and consider scaling out at the “Take Profit” labels as price reaches the next zones. Treat these labels as a structured map rather than a promise. Always wait for your own confirmation, such as a candle close that respects the zone, and always size your risk.
How it works in plain language
The script waits for real, confirmed turning points in price called pivots. When a pivot forms, it gets saved into a rolling list of recent turning points. The script then looks for tight groups of those pivots that sit near each other in price. The allowed distance for a group is not fixed. It scales with the asset’s recent 300 bar range so that busy, volatile markets get wider tolerance and quiet markets get tighter tolerance. Each group of nearby pivots becomes a candidate zone. The number of pivots inside the group is the strength of the zone. If two candidate zones overlap in price, the script keeps the stronger one and removes the weaker one. Only the strongest zones are kept on the chart up to your chosen limit. For each final zone the midpoint is the single reference used for tinting, labels, and alerts. This keeps the logic consistent and easy to reason about.
Technical explanation for advanced users
Pivot detection is based on a symmetric period length over either High or Low, or a Close or Open surrogate using max and min. Each confirmed pivot is unshifted into an array capped by your “Maximum Number of Pivot”. On rebuild, a clustering pass iterates over the array to compute zone candidates. The cluster width equals the recent 300 bar range multiplied by “Maximum Channel Width %”. For a given seed value the pass grows the candidate by including any pivot value that stays within the current low to high bounds while the total spread remains within the width threshold. The count of included pivots is the strength metric. A second pass enforces mutual exclusion, replacing an existing zone with a new one if the new strength is higher within an overlapping price interval. Zones are kept in descending order of strength and trimmed to “Maximum Number of S/R”. Each drawn zone uses a midpoint rounded to mintick for label clarity. The visual is a background box centered around the midpoint with a small pad for legibility. Zone shading updates every bar so the support or resistance tint always reflects the current close, while the full set of zones and trade labels rebuild on new pivot confirmation. Alerts compute midpoint crosses using close on the previous bar versus the current close to avoid repainting.
Inputs and practical tuning in real trading
Pivot Period controls how quickly turning points confirm. Lower values confirm sooner and create more candidate pivots, which can make zones appear faster at the cost of noise. Source lets you choose between High and Low or a Close and Open surrogate that can be more conservative during gaps. Maximum Number of Pivot caps memory and performance. Maximum Channel Width % scales zone formation relative to the last 300 bars. If your chart looks messy, reduce this percentage to demand tighter clusters and raise Minimum Strength so that only zones formed by multiple pivots survive. Maximum Number of S or R limits the number of visible zones so the view stays readable. Label Location shifts labels to the right if they sit too close to candles. The trade setup block has a switch to show or hide guidance, a number that controls how many take profits you want to see, and a Stop Loss Buffer percent that extends beyond the zone height to account for volatility and slippage. If you want fewer signals, raise Minimum Strength and lower the channel width. If you want more signals, do the opposite. If labels overlap on lower timeframes, move Label Location farther to the right.
Reading the zones with a repeatable workflow
Begin on a higher timeframe to understand the main structure then drop to a lower timeframe to refine entries around the same zones. When price approaches a support zone from above, look for a reaction such as a wick rejection, a strong close back above the midpoint, or a quick reclaim after a shallow break. When price approaches a resistance zone from below, watch for hesitation, lower highs inside the zone, or a decisive close under the midpoint. If you use the optional trade setup labels, treat the midpoint entry as a baseline. Use the buffer based stop as a pre planned exit that avoids getting tagged by normal chop inside the zone. Use the staged take profits at the next zone midpoints to reduce risk as price reaches logical targets. Alerts on midpoint crosses can help you monitor multiple charts without staring at them.
Alerts and how to set them
Open the alert dialog on TradingView and select one of the three exposed conditions. Choose “Resistance Broken” when you want a notification for crosses above any zone midpoint, “Support Broken” when you want a notification for crosses below any zone midpoint, or the combined condition if you simply want to know when price has moved through any midpoint in either direction. Consider adding a secondary filter in your trading plan, for example only take alerts that align with the higher timeframe bias.
Notes, limitations, and expectations
Pivots confirm only after the chosen period, which means zones update when a new pivot locks in. This is intentional and avoids repainting. If price moves far without forming a new pivot, the optional trade setup labels will not update until the next pivot confirms. Zones are derived from recent data and can change as new pivots arrive. Treat the script as a structure and risk framework, not as a signal generator. Your own confirmation, risk sizing, and trade management remain essential.
Originality
This publication and code are original works by the author. No third party or open source code was reused.
Publication guidance to satisfy moderator checks
Use a clean chart for your main screenshot so the shaded boxes and labels are obvious. If you show the optional trade setup labels, include a short caption that explains Entry, Stop Loss, and Take Profit placement. If you show the alert dialog, include a second image with a brief caption so reviewers can match the conditions to what the script exposes.
Changelog
Version 2 introduces strength ordered clustering with overlap resolution, range scaled width based on the last 300 bars, midpoint based coloring and alerts, optional trade setup labels with a buffer based stop and multiple take profits, and timeframe aware zone labels. Presentation defaults were tuned so zones and labels are readable on a blank chart.
Disclaimer
This tool is for research and charting. It does not predict outcomes or guarantee results. Always validate ideas with your own method and manage risk accordingly.
Alert condition references
Skrip jemputan sahaja
Hanya pengguna yang diluluskan oleh penulis boleh mengakses skrip ini. Anda perlu memohon dan mendapatkan kebenaran untuk menggunakannya. Ini selalunya diberikan selepas pembayaran. Untuk lebih butiran, ikuti arahan penulis di bawah atau hubungi terus cryptopastor001.
TradingView tidak menyarankan pembayaran untuk atau menggunakan skrip kecuali anda benar-benar mempercayai penulisnya dan memahami bagaimana ia berfungsi. Anda juga boleh mendapatkan alternatif sumber terbuka lain yang percuma dalam skrip komuniti kami.
Arahan penulis
Amaran: sila baca panduan kami untuk skrip jemputan sahaja sebelum memohon akses.
Penafian
Skrip jemputan sahaja
Hanya pengguna yang diluluskan oleh penulis boleh mengakses skrip ini. Anda perlu memohon dan mendapatkan kebenaran untuk menggunakannya. Ini selalunya diberikan selepas pembayaran. Untuk lebih butiran, ikuti arahan penulis di bawah atau hubungi terus cryptopastor001.
TradingView tidak menyarankan pembayaran untuk atau menggunakan skrip kecuali anda benar-benar mempercayai penulisnya dan memahami bagaimana ia berfungsi. Anda juga boleh mendapatkan alternatif sumber terbuka lain yang percuma dalam skrip komuniti kami.
Arahan penulis
Amaran: sila baca panduan kami untuk skrip jemputan sahaja sebelum memohon akses.