OPEN-SOURCE SCRIPT
מעודכן Opening Range Breakout Engine - Session Range Signals

aDESCRIPTION:
RANGE BREAKOUT PRO is a complete range-breakout trading engine: it detects tradeable ranges from confirmed swing pivots, fires BUY and SELL signals when price breaks out in the direction of the trend, and then manages every trade on the chart with entry, stop loss, take profit, break-even and trailing logic - all fully visualized and fully automatable via webhook alerts.
HOW THE ENGINE WORKS
1. RANGE DETECTION - Confirmed swing highs and swing lows (pivot length configurable) become the active RANGE HIGH and RANGE LOW. Each extreme is marked on the chart with a dot and a vertical marker line. A range must be wide enough (minimum height in ATR) and fresh enough (maximum age in bars) to be tradeable - micro-ranges and stale levels are skipped automatically.
2. BREAKOUT SIGNAL - A signal fires only when a candle CLOSES beyond the range extreme plus an ATR buffer (no wick fake-outs), the gradient trend ribbon points in the breakout direction, the trend strength score clears your Buy/Sell Strength threshold, the breakout is not overextended (max distance from the ribbon in ATR - no chasing exhausted moves), and an optional cooldown after a losing trade has expired. Optional MTF Agreement requires the 15-minute trend to confirm.
3. TRADE MANAGEMENT - Every signal is managed like a real trade, live on the chart:
- TP1 (partial target) banks the win early and moves the stop to break-even
- the remainder runs to the full R-multiple take profit or a chandelier trail
- green TP box and red SL box grow bar by bar from the entry, exactly like a position tool
- price tags at the right edge show Entry, Stop Loss, Take Profit and live Profit/Loss %
- every closed trade is marked with a tick (win), circle (break-even) or cross (loss)
4. TWO TRADE MODES - "TP/SL Mode" (fixed targets, split TP1 + runner) or "Trailing Mode" (no fixed target, the trail line is the moving stop).
THE COCKPIT PANEL
- MARKET OVERVIEW: multi-timeframe trend dashboard - live trend strength meters for the chart timeframe, 15m, 1H, 4H and 1D
- SIGNAL SETUP: entry system, MTF agreement, current signal (Long / Flat / Short), Buy/Sell strength thresholds, trend filter state, trade mode, active Take Profit and Stop Loss levels
- PERFORMANCE: asset, exchange, timeframe, total trades and live win rate calculated from every signal on the chart history - no cherry picking, the counter runs over everything the engine fired
Win rate accounting is transparent: a trade counts as WIN when TP1 is banked, as LOSS when the initial stop is hit first, and break-even exits are tracked separately - the same split-target accounting professional scalpers use.
WHY-EXPLANATIONS ON THE CHART
Every BUY/SELL pill carries a tooltip that explains WHY the signal fired: which range level broke, the trend strength at the trigger, entry, stop and target prices. Range dots explain the level they mark. Nothing is a black box.
WEBHOOK AUTOMATION
Create one alert with condition "Any alert() function call" and paste your webhook URL. The indicator sends ready-to-use JSON for every event: BUY, SELL, TP_HIT, SL_HIT, TRAIL_EXIT, BE_EXIT - including symbol, price, stop, target, trade mode, win rate and timeframe. Connect it to any bridge or bot and the strategy runs hands-free.
WORKS ON
Any symbol and timeframe: indices (NASDAQ, S&P, DAX), gold and forex, crypto, stocks. Scalping on 1-5 minute charts, day trading on 15m-1H, swing trading on 4H-Daily. Defaults are tuned for intraday breakout scalping.
DISCLAIMER
This indicator is a technical analysis tool, not financial advice. Past win rates do not guarantee future results. Always test on a demo account first and manage your risk.
WHY THESE PARTS BELONG TOGETHER
An opening range on its own produces a break in both directions on most days. The session filter
and the range-quality measurement exist to decide which of those breaks is tradeable: the session
defines when the range is allowed to form, and the quality measurement rejects ranges that are too
wide or too thin to hold. The breakout level is only meaningful once both have passed.
RANGE BREAKOUT PRO is a complete range-breakout trading engine: it detects tradeable ranges from confirmed swing pivots, fires BUY and SELL signals when price breaks out in the direction of the trend, and then manages every trade on the chart with entry, stop loss, take profit, break-even and trailing logic - all fully visualized and fully automatable via webhook alerts.
HOW THE ENGINE WORKS
1. RANGE DETECTION - Confirmed swing highs and swing lows (pivot length configurable) become the active RANGE HIGH and RANGE LOW. Each extreme is marked on the chart with a dot and a vertical marker line. A range must be wide enough (minimum height in ATR) and fresh enough (maximum age in bars) to be tradeable - micro-ranges and stale levels are skipped automatically.
2. BREAKOUT SIGNAL - A signal fires only when a candle CLOSES beyond the range extreme plus an ATR buffer (no wick fake-outs), the gradient trend ribbon points in the breakout direction, the trend strength score clears your Buy/Sell Strength threshold, the breakout is not overextended (max distance from the ribbon in ATR - no chasing exhausted moves), and an optional cooldown after a losing trade has expired. Optional MTF Agreement requires the 15-minute trend to confirm.
3. TRADE MANAGEMENT - Every signal is managed like a real trade, live on the chart:
- TP1 (partial target) banks the win early and moves the stop to break-even
- the remainder runs to the full R-multiple take profit or a chandelier trail
- green TP box and red SL box grow bar by bar from the entry, exactly like a position tool
- price tags at the right edge show Entry, Stop Loss, Take Profit and live Profit/Loss %
- every closed trade is marked with a tick (win), circle (break-even) or cross (loss)
4. TWO TRADE MODES - "TP/SL Mode" (fixed targets, split TP1 + runner) or "Trailing Mode" (no fixed target, the trail line is the moving stop).
THE COCKPIT PANEL
- MARKET OVERVIEW: multi-timeframe trend dashboard - live trend strength meters for the chart timeframe, 15m, 1H, 4H and 1D
- SIGNAL SETUP: entry system, MTF agreement, current signal (Long / Flat / Short), Buy/Sell strength thresholds, trend filter state, trade mode, active Take Profit and Stop Loss levels
- PERFORMANCE: asset, exchange, timeframe, total trades and live win rate calculated from every signal on the chart history - no cherry picking, the counter runs over everything the engine fired
Win rate accounting is transparent: a trade counts as WIN when TP1 is banked, as LOSS when the initial stop is hit first, and break-even exits are tracked separately - the same split-target accounting professional scalpers use.
WHY-EXPLANATIONS ON THE CHART
Every BUY/SELL pill carries a tooltip that explains WHY the signal fired: which range level broke, the trend strength at the trigger, entry, stop and target prices. Range dots explain the level they mark. Nothing is a black box.
WEBHOOK AUTOMATION
Create one alert with condition "Any alert() function call" and paste your webhook URL. The indicator sends ready-to-use JSON for every event: BUY, SELL, TP_HIT, SL_HIT, TRAIL_EXIT, BE_EXIT - including symbol, price, stop, target, trade mode, win rate and timeframe. Connect it to any bridge or bot and the strategy runs hands-free.
WORKS ON
Any symbol and timeframe: indices (NASDAQ, S&P, DAX), gold and forex, crypto, stocks. Scalping on 1-5 minute charts, day trading on 15m-1H, swing trading on 4H-Daily. Defaults are tuned for intraday breakout scalping.
DISCLAIMER
This indicator is a technical analysis tool, not financial advice. Past win rates do not guarantee future results. Always test on a demo account first and manage your risk.
WHY THESE PARTS BELONG TOGETHER
An opening range on its own produces a break in both directions on most days. The session filter
and the range-quality measurement exist to decide which of those breaks is tradeable: the session
defines when the range is allowed to form, and the quality measurement rejects ranges that are too
wide or too thin to hold. The breakout level is only meaningful once both have passed.
הערות שחרור
Version note added. The preview chart has also been replaced: the earlier snapshot accidentally showed several indicators stacked on one chart, this one shows the indicator on its own.הערות שחרור
Fix: on some symbols and zoom levels the dark theme's right-hand margin box stretched the price scale so far that the candles collapsed into a flat line. The margin box now uses the recent high/low range instead of an artificial extreme, so the price scale stays correct.הערות שחרור
House Rules cleanup: the brand abbreviation has been removed from the input labels and from the default webhook id.סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.