OPEN-SOURCE SCRIPT
Range Zones Alerts

Range Zones — Buy the Green, Sell the Red
Get alerted when price enters a buy zone or a sell zone.
This indicator detects the current trading range, splits it into three color-coded zones, and sends you an alert the moment price touches the zone you care about. No guessing where support and resistance are — the indicator finds them for you.
Green Zone = Buy Zone
The bottom third of the range is shaded green. This is where price has historically found support. When price drops into the green, buyers tend to step in. Set up the Bull alert and get notified the instant price touches this zone — that's your signal to start looking for a long entry.
Red Zone = Sell Zone
The top third of the range is shaded pink/red. This is where price has historically hit resistance. When price pushes into the red, sellers tend to step in. Set up the Bear alert and get notified the instant price touches this zone — that's your signal to start looking for a short entry or to take profits on longs.
Blue Zone = No Trade Zone
The middle third is shaded blue. Price is stuck between support and resistance with no clear edge in either direction. When price is in the blue, wait.
Alerts
Three options in TradingView's alert panel:
— Bull Alert: fires when price touches the green support zone.
— Bear Alert: fires when price touches the red resistance zone.
— Both: fires on either — one alert covers everything.
A built-in cooldown (default 20 bars) prevents spam. You get one alert per zone touch, then silence until the cooldown clears. Bull and bear cooldowns are independent — a green zone alert won't block a red zone alert.
How It Works
The indicator uses pivot-based swing detection to find the most recent significant high and low. The range between them is divided into three equal horizontal zones. The zones update automatically as new swing highs and lows form. A Max Range Age setting ensures stale, outdated ranges are dropped.
Settings
— Pivot Strength: how significant the swing points need to be. Default 20. Higher = wider ranges.
— Max Range Age: how old the range can be before it's dropped. Default 300 bars.
— Alert Cooldown: bars of silence after an alert fires. Default 20.
— Zone Colors: fully customizable.
Works on any ticker, any timeframe. Add it to your chart, set up your alerts, and let the zones tell you when it's time to trade.
Get alerted when price enters a buy zone or a sell zone.
This indicator detects the current trading range, splits it into three color-coded zones, and sends you an alert the moment price touches the zone you care about. No guessing where support and resistance are — the indicator finds them for you.
Green Zone = Buy Zone
The bottom third of the range is shaded green. This is where price has historically found support. When price drops into the green, buyers tend to step in. Set up the Bull alert and get notified the instant price touches this zone — that's your signal to start looking for a long entry.
Red Zone = Sell Zone
The top third of the range is shaded pink/red. This is where price has historically hit resistance. When price pushes into the red, sellers tend to step in. Set up the Bear alert and get notified the instant price touches this zone — that's your signal to start looking for a short entry or to take profits on longs.
Blue Zone = No Trade Zone
The middle third is shaded blue. Price is stuck between support and resistance with no clear edge in either direction. When price is in the blue, wait.
Alerts
Three options in TradingView's alert panel:
— Bull Alert: fires when price touches the green support zone.
— Bear Alert: fires when price touches the red resistance zone.
— Both: fires on either — one alert covers everything.
A built-in cooldown (default 20 bars) prevents spam. You get one alert per zone touch, then silence until the cooldown clears. Bull and bear cooldowns are independent — a green zone alert won't block a red zone alert.
How It Works
The indicator uses pivot-based swing detection to find the most recent significant high and low. The range between them is divided into three equal horizontal zones. The zones update automatically as new swing highs and lows form. A Max Range Age setting ensures stale, outdated ranges are dropped.
Settings
— Pivot Strength: how significant the swing points need to be. Default 20. Higher = wider ranges.
— Max Range Age: how old the range can be before it's dropped. Default 300 bars.
— Alert Cooldown: bars of silence after an alert fires. Default 20.
— Zone Colors: fully customizable.
Works on any ticker, any timeframe. Add it to your chart, set up your alerts, and let the zones tell you when it's time to trade.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
Jason Parker is the author of tradinghabits.com/ an editorial site on trading and investing.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
Jason Parker is the author of tradinghabits.com/ an editorial site on trading and investing.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.