OPEN-SOURCE SCRIPT
BRAYITAN S/R Horizontal

BRAYITAN S/R Horizontal — Indicator Description
This is a multi-timeframe Support & Resistance indicator for TradingView, written in Pine Script v5. Here's a full breakdown:
What It Does
It automatically detects and draws horizontal support and resistance lines based on pivot highs and lows from two configurable timeframes (default: M5 and M15), directly on your chart regardless of which timeframe you're currently viewing.
Core Features
Pivot Detection
It uses ta.pivothigh and ta.pivotlow with configurable left/right bar lookback to identify significant price turning points on each timeframe via request.security.
Duplicate Filtering
Before storing a new pivot, it checks whether a level already exists within 0.05% proximity — preventing near-identical lines from cluttering the chart.
Touch Counting
Every bar, the script scans all stored levels and increments a touch counter whenever price (high or low) comes within a user-defined tolerance (default 0.1%) of any level. This measures how many times price has respected a level.
Dynamic Line Thickness
Lines automatically thicken based on touch count — 3+ touches adds 1px, 5+ touches adds 2px — visually highlighting the strongest levels.
Strength Symbols
Labels show ⚡ for levels touched 3+ times and 🔥 for 5+ times.
Visuals
Draws up to N lines per timeframe (default 5 each), projected forward on the chart
Labels show: timeframe tag (S/M5, R/M15, etc.), price, touch count, and strength emoji
Fully customizable colors, line style (solid/dotted/dashed), and thickness per timeframe
Background color flashes when price approaches any S/R level (blue for M5, orange for M15)
Alerts
Four alert conditions are built in:
AlertTriggerResistance M5 reachedClose within 0.3% of M5 pivot highSupport M5 reachedClose within 0.3% of M5 pivot lowResistance M15 reachedClose within 0.3% of M15 pivot highSupport M15 reachedClose within 0.3% of M15 pivot low
Practical Use Case
Ideal for scalpers and intraday traders who want to see higher-timeframe (M15) key levels layered over a lower-timeframe (M5) chart, with visual cues about which levels have been tested most — helping prioritize trade entries, stops, and targets around the strongest zones.
This is a multi-timeframe Support & Resistance indicator for TradingView, written in Pine Script v5. Here's a full breakdown:
What It Does
It automatically detects and draws horizontal support and resistance lines based on pivot highs and lows from two configurable timeframes (default: M5 and M15), directly on your chart regardless of which timeframe you're currently viewing.
Core Features
Pivot Detection
It uses ta.pivothigh and ta.pivotlow with configurable left/right bar lookback to identify significant price turning points on each timeframe via request.security.
Duplicate Filtering
Before storing a new pivot, it checks whether a level already exists within 0.05% proximity — preventing near-identical lines from cluttering the chart.
Touch Counting
Every bar, the script scans all stored levels and increments a touch counter whenever price (high or low) comes within a user-defined tolerance (default 0.1%) of any level. This measures how many times price has respected a level.
Dynamic Line Thickness
Lines automatically thicken based on touch count — 3+ touches adds 1px, 5+ touches adds 2px — visually highlighting the strongest levels.
Strength Symbols
Labels show ⚡ for levels touched 3+ times and 🔥 for 5+ times.
Visuals
Draws up to N lines per timeframe (default 5 each), projected forward on the chart
Labels show: timeframe tag (S/M5, R/M15, etc.), price, touch count, and strength emoji
Fully customizable colors, line style (solid/dotted/dashed), and thickness per timeframe
Background color flashes when price approaches any S/R level (blue for M5, orange for M15)
Alerts
Four alert conditions are built in:
AlertTriggerResistance M5 reachedClose within 0.3% of M5 pivot highSupport M5 reachedClose within 0.3% of M5 pivot lowResistance M15 reachedClose within 0.3% of M15 pivot highSupport M15 reachedClose within 0.3% of M15 pivot low
Practical Use Case
Ideal for scalpers and intraday traders who want to see higher-timeframe (M15) key levels layered over a lower-timeframe (M5) chart, with visual cues about which levels have been tested most — helping prioritize trade entries, stops, and targets around the strongest zones.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.