PulseHub
OPEN-SOURCE SCRIPT

S/R Zones

389
S/R Zones — Volume-Based Support & Resistance

OVERVIEW
S/R Zones automatically detects relevant support and resistance zones based on abnormal volume activity. It is a support/resistance indicator based on volume: instead of relying on manually drawn horizontal lines, it identifies the price zones created by unusually high-volume bars and tracks how price interacts with them over time.

HOW IT WORKS
1. Volume signal — The script looks for a bar whose volume is both the highest of the last N bars and at least X times the average volume of those bars (both configurable). This filters out ordinary volume fluctuations and keeps only genuinely abnormal activity.
2. Confirmation — After a high-volume bar, the indicator waits for the first bar that closes in the opposite direction (there can be several same-direction bars in between).
3. Zone boundaries — The zone is built from two price levels: P, the furthest high/low reached between the bar right after the signal and the confirmation bar (the signal bar itself is excluded); and R, the nearest prior confirmed pivot high/low that goes beyond P.
4. Pivot-based R — R is only taken from genuine swing points: a bar whose high/low is the most extreme of a configurable number of bars on each side (left/right). This avoids anchoring the zone to a random nearby wick that isn't part of the actual price structure.
5. ATR-based filtering — Zones narrower than a configurable multiple of the ATR are discarded. Because ATR reflects the typical volatility of the current symbol and timeframe, this threshold automatically adapts across assets and timeframes without manual tuning.
6. Continuous tracking — Once formed, a zone is not discarded after being touched once. It stays on the chart and keeps being tracked indefinitely, since a broken support can later act as resistance (and vice versa) — a common real-world behavior this script is designed to visualize.
7. Visual break marker — When price closes beyond a zone's outer edge by a configurable ATR-based margin, the zone's color switches to a dashed gray to flag a possible break. The zone keeps extending afterward, since it may still be retested from the other side.

WHAT IT'S MADE OF
- Volume + candle-color logic to detect signal and confirmation bars
- A backward-only search (no lookahead) to compute each zone's two boundaries
- Confirmed-pivot detection so a zone's outer boundary reflects genuine price structure, not a random wick
- ATR-based, auto-adjusting filters for minimum zone width and break margin
- A rolling set of tracked zones (oldest removed first once the maximum is reached)
- Optional alerts for new zone formation and possible zone breaks
- An optional diagnostic mode with visual markers for tuning settings on a new symbol/timeframe

HOW TO USE IT
Add it to any chart with real volume data (stocks, futures, crypto on major exchanges). Blue boxes mark resistance zones, orange boxes mark support zones; a dashed gray box signals a possible break. Use the settings to adjust sensitivity (volume lookback/ratio, pivot left/right bars, ATR-based width and margin, max zones shown) to match the instrument and timeframe you're trading. If no zones appear, enable "Show diagnostics" to see exactly which filter is holding signals back.

NOTES
- Requires real volume data. Symbols/feeds without real volume (some forex/CFD feeds on certain timeframes) may not produce reliable signals.
- The "possible break" color change is a visual aid based on a fixed rule, not a guaranteed prediction — always confirm with your own price action analysis.

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 PulseWire. Read more in the Terms of Use.