OPEN-SOURCE SCRIPT
Güncellendi Auto Support & Resistance Zones

Auto Support & Resistance Zones (Horizontal Rays)
This lightweight indicator automatically detects key structural swing highs and swing lows (fractals / pivot points) and projects them into the future as continuous horizontal rays. It draws both the primary pivot level and an adjustable shaded supply/demand zone around each structure.
How It Works
Fractal / Pivot Detection: Uses customizable left and right lookback lengths to confirm validated swing highs (resistance) and swing lows (support).
Horizontal Rays: Levels automatically extend to the right across the chart, giving clear forward targets and reaction zones without cluttering historical candles.
Zone Thickness: Rather than treating support and resistance as razor-thin lines, it allows users to specify a percentage-based threshold to capture realistic price action buffers.
Memory Management: Dynamically prunes older, stale zones to keep your chart clean and maintain fast rendering speeds.
Key Settings
Pivot Lookback (Left / Right): Determines the sensitivity of the pivots. Higher numbers isolate major macro swing points; lower numbers identify short-term intraday pivots.
Max Active Levels: Limits the total number of recent support and resistance zones actively displayed on the chart.
Zone Thickness (%): Adjusts the height of the shaded reaction band above/below the central pivot line (set to 0 for single lines).
Color Customization: Full control over ray and fill colors for both resistance and support levels.
This lightweight indicator automatically detects key structural swing highs and swing lows (fractals / pivot points) and projects them into the future as continuous horizontal rays. It draws both the primary pivot level and an adjustable shaded supply/demand zone around each structure.
How It Works
Fractal / Pivot Detection: Uses customizable left and right lookback lengths to confirm validated swing highs (resistance) and swing lows (support).
Horizontal Rays: Levels automatically extend to the right across the chart, giving clear forward targets and reaction zones without cluttering historical candles.
Zone Thickness: Rather than treating support and resistance as razor-thin lines, it allows users to specify a percentage-based threshold to capture realistic price action buffers.
Memory Management: Dynamically prunes older, stale zones to keep your chart clean and maintain fast rendering speeds.
Key Settings
Pivot Lookback (Left / Right): Determines the sensitivity of the pivots. Higher numbers isolate major macro swing points; lower numbers identify short-term intraday pivots.
Max Active Levels: Limits the total number of recent support and resistance zones actively displayed on the chart.
Zone Thickness (%): Adjusts the height of the shaded reaction band above/below the central pivot line (set to 0 for single lines).
Color Customization: Full control over ray and fill colors for both resistance and support levels.
Sürüm Notları
**Release Notes / Version Update*** **Dynamic S/R Role Reversal:** Lines now dynamically adapt their color in real time based on current price—levels above close display in green/teal (Resistance), while levels below flip to crimson/red (Support).
* **Retest & Validation Engine:** Added structural touch filtering so lines only qualify after being tested multiple times, removing unconfirmed single-wick noise.
* **Macro Horizon Persistence:** Re-anchored level tracking to timestamps (`xloc.bar_time`) and protected macro extremes, ensuring major cycle peaks and floors remain visible across all historical zoom levels.
* **Streamlined, Non-Obtrusive Visuals:** Removed heavy halo/bloom glow boxes in favor of clean, 1-pixel hairline rays.
* **Custom Styling & Transparency:** Added user inputs to adjust line opacity (0–90%) and select line styles (Solid, Dashed, Dotted) to prevent obscuring candle action.
* **Proximity Clustering:** Merged closely spaced pivot levels to prevent overlapping lines in tight consolidation areas.
* **Toggleable Markers:** Pivot high/low triangle shapes are now set to "off" by default with an optional toggle in settings.
Sürüm Notları
Release Notes / Version UpdateMacro Peak & Base Priority Protection: Fixed an issue where major un-retested blow-off tops (like the macro peak spike) and cycle floors were suppressed. Absolute extremes now bypass touch thresholds to remain permanently drawn.
Refined Pivot & Retest Sensitivity: Changed default minTouches to 1 for macro swings while retaining proximity clustering, allowing true high-timeframe structural turns to plot immediately without waiting for a retest.
Subtle Non-Obtrusive Styling: Removed opaque beams and glow halos. Added controls for Line Transparency (0–90%) and Line Pattern (Solid, Dashed, Dotted) so lines sit discreetly behind price action.
Dynamic Role Reversal: Lines automatically flip color based on current price—teal/green for overhead resistance, crimson/red for underlying support.
Zoom-Safe Timestamp Anchoring: All horizontal rays use time coordinates (xloc.bar_time) so historical macro lines do not disappear or distort when zooming out across long chart histories.
Sürüm Notları
**Release Notes / Version Update*** **Permanent Macro Peak & Floor Anchoring:** Added dedicated extreme-tracking registers (`macroPeakPrice` and `macroFloorPrice`). Macro blow-off peaks and major cycle bottoms are now permanently retained and drawn, preventing historical arrays from pruning them during multi-month consolidations.
* **Separated High & Low Pivot Pools:** Isolated swing highs and swing lows into distinct tracking structures so long periods of bottom consolidation can no longer crowd out or overwrite overhead resistance levels.
* **Immediate Major Swing Plotting (`minTouches = 1`):** Calibrated the default touch threshold to `1`, allowing clean high-timeframe pivot highs and lows to plot immediately as rays rather than waiting for an unconfirmed retest.
* **Native Value-Array Sorting:** Replaced mutable object references with native parallel primitive arrays (`float` and `int`), resolving sorting drops that previously caused the top resistance line to vanish on final-bar render passes.
* **Refined Dynamic S/R Flipping:** Retained real-time role reversal—levels overhead display in subtle teal/green (Resistance), while levels broken and held underneath price render in crimson/red (Support).
* **Subtle Hairline Styling:** Fully customizable opacity (0–90%) and line pattern options (Solid, Dashed, Dotted) to ensure structural rays sit cleanly behind price action without overpowering candle patterns.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.