تم تحديثه
SRBS Rangeflow | NICK789

SRBS Rangeflow [NICK789] - Structured Range Signals, Market Context and Adaptive Trade Planning
Sorry I haven't published a script for a while. Life has been keeping me busy, lol. In between everything else, I've been working on SRBS Rangeflow. I'm pleased to finally share it with the TradingView community.
OVERVIEW
SRBS stands for Smart Range Breakout System. Rangeflow is a price-chart indicator that combines volatility-compression and range analysis, an ATR-based directional trail, higher-timeframe market context, and a configurable three-target trade-planning model.
The objective is to provide a consistent way to read a directional event: where it originated, whether the surrounding market structure supports it, and how a possible entry, stop and set of targets would look on the chart. Signal generation and context assessment are deliberately separate. A bearish context reading does not remove a bullish SRBS signal, and a favourable reading does not automatically qualify it as a trade.
The display uses compact long/short tags, a trend cloud, a small context panel and optional risk/reward rails. The aim is to retain useful information without overwhelming the price chart.
CONCEPTUAL FRAMEWORK
Rangeflow is built around three connected functions:
1. DETECTION - Identify volatility compression and validate a price range using repeated interaction with its boundaries. A separate ATR trailing model tracks changes in directional state.
2. CONTEXT - Describe higher-timeframe structure, directional efficiency, trend strength and smoothed price behaviour around each SRBS event.
3. PLANNING - Translate a confirmed event into a visual entry, stop and three risk-based targets, with optional position-sizing estimates and simulated outcome tracking.
Each function has a distinct role. The context panel is an interpretation tool rather than a second entry engine, while the trade-planning layer is a visual simulation rather than an order-management system.
RANGE DETECTION AND SIGNAL FOUNDATION
The range engine begins by comparing current Average True Range (ATR) with an average of recent ATR values. A compression condition must persist for a minimum number of bars before a range candidate can qualify.
Potential upper and lower boundaries are estimated from rolling high and low price percentiles. With structure validation enabled, the script also examines:
- Boundary interactions: how often candles reach the tolerance area around each edge.
- Midpoint rotations: how often closing prices cross the range midpoint.
- Containment: the proportion of closes that remain between the candidate boundaries.
- Range width: whether the calculated upper and lower levels form a meaningful price interval.
Once qualified, the range boundaries are held as references until the range resolves. A bullish or bearish range event occurs when an EMA-smoothed typical-price series crosses the corresponding boundary.
Alongside the range engine, the ATR step trail maintains a directional state. Its step-like stop adjusts with the prevailing direction and can change state when price crosses the prior trail or a qualified range breakout establishes a new direction. This gives Rangeflow both consolidation-break and trend-transition information.
SIGNAL LOGIC
The Signal Source setting controls which events generate the L and S tags:
- Original Trend Flips (default): directional changes in the combined SRBS trend state.
- ATR Trail Flips Only: trend changes caused by the trailing model, excluding range-break events.
- Range Breakouts Only: qualifying crosses of established range boundaries.
- Both Separate Events: ATR trail flips and range breakouts as separate signal types.
Aggressive, Balanced and Conservative presets adjust the compression lookback, minimum compression duration and ATR trail multiplier. Custom mode exposes those sensitivity settings directly. A configurable signal cooldown controls the minimum spacing between qualifying events.
Green L tags indicate bullish SRBS events; red S tags indicate bearish events. Amber lettering warns when the nearest available higher-timeframe structure is not supportive or is unclear. It does not remove the underlying signal.
MARKET CONTEXT
The optional context panel presents several complementary measurements:
Higher-timeframe structure
Confirmed swing highs and lows are compared to assess directional structure. The default references are 5m, 15m and 1H, with 4H available as a fallback when the shorter references are not higher than the chart timeframe. The panel derives a weighted directional assessment from eligible timeframes. Pivot confirmation introduces an intentional delay.
Market regime
A 0-100 conditions score blends four measurements: ADX trend strength (35%), price efficiency (30%), EMA separation relative to ATR (20%), and ATR activity relative to its baseline (15%). Readings are grouped as CHOP (below 50), DEVELOPING (50 to below 65), or TRENDING (65 and above). This is a description of price behaviour, not a probability of trade success. On chart timeframes below five minutes, the score uses the previous completed five-minute bar.
Gaussian and HTF reference
A Gaussian-weighted moving centreline gives a smoothed view of price direction. A separate comparison of the previous completed higher-timeframe close with its EMA supplies broader directional context. These measurements are advisory and do not create or veto SRBS signals.
Recent-signal assessment
The panel relates the latest SRBS signal to the available structure and regime readings. Examples include CHOP RISK, COUNTERTREND, HTF UNCERTAIN, and ALIGNED / TRENDING. These are descriptive observations, not trading instructions.
VISUAL TRADE PLANNING
When visual plans are enabled, a confirmed SRBS signal can begin a simulated plan using the signal candle's closing price as the reference entry. Only one plan is tracked at a time.
The default stop method is Structure. For long plans, it references the lowest low of the selected number of preceding completed bars; for short plans, it references the highest high. An ATR buffer is added beyond that level and a minimum ATR stop distance is enforced. The stop is not capped in a way that would deliberately pull it back inside the selected structure.
Other available stop methods are:
- Auto: ATR-based distance that adapts to the instrument's current volatility, with market-appropriate distance labels.
- ATR: user-selected ATR period and multiplier.
- Ticks: a fixed number of the chart symbol's minimum price increments.
- Pips: a fixed pip distance, with automatic conventional forex pip sizing and a manual override.
- Percent: a fixed percentage of the reference entry price.
Auto adjusts the stop distance through ATR; it does not automatically identify structural highs and lows. Structure is a separate, selectable method. Pip sizes, point values and trading increments may differ across broker feeds, especially for metals and CFDs.
The entry-to-stop distance is defined as 1R. Three target levels are projected using adjustable multiples of that distance. The default settings are T1 = 0.5R, T2 = 1.0R and T3 = 1.5R. Prices are rounded to the symbol's minimum tick, and target ordering is preserved after rounding.
The active plan shows entry, stop and target price rails, with lightly shaded risk and reward areas. These levels are mathematical projections; they are not inferred liquidity pools or predicted destinations.
OPTIONAL RISK-BASED POSITION SIZING
Position sizing is disabled by default. When enabled, the user can specify an account balance and a risk percentage or enter a fixed cash-risk budget.
The quantity estimate uses the entry-to-stop distance, the instrument's point value and an account-currency conversion where available. It rounds down to a configurable quantity increment and reports when the required instrument or exchange-rate information is unavailable, or when the calculated size is below the minimum increment.
Depending on the chart symbol, the display may express quantity as contracts, lots, shares or units. Broker specifications and margin requirements must be checked independently. The script cannot read an account balance, place orders or guarantee that actual losses will remain within the displayed budget.
TRADE-PLAN MANAGEMENT AND HISTORICAL RESULTS
For modelled outcomes, each plan is divided into three equal portions, one assigned to each target. When price touches a target, that portion is recorded at its corresponding R multiple. If price reaches the stop, any uncompleted portions are treated as stopped.
Reverse Plan on Opposite Signal is enabled by default. A confirmed opposite SRBS signal can close the remaining simulated portions at that candle's close and start a new plan in the other direction. If the stop or final target was reached on the same candle, that event takes priority over the reversal. The feature can be disabled to hold the current plan until it reaches its stop or final target.
When Keep Completed T3 Plans is enabled, fully completed three-target plans remain visible as understated historical entry, stop and target rails with one compact completion tag. Five completed T3 plans are retained by default, with a configurable maximum. Stopped, partially completed and reversed plans can retain result labels, allowing outcomes other than full target completions to remain visible.
The model offers a Stop First / Targets First setting for bars whose high-low range includes both an exit target and the stop. Stop First is the default conservative assumption. Historical candle data cannot establish the actual sequence of every intrabar touch.
CHART INTERPRETATION
- Compression range: a dashed boundary box marking the detected consolidation structure.
- SRBS centre, trail and cloud: the reference average, step-trailing level and directional background between them.
- L / S tags: bullish and bearish events from the selected SRBS signal source.
- Amber tag lettering: caution regarding the nearest available higher-timeframe structure.
- Context panel: structure, regime, smoothed/HTF direction, recent signal and simulated-plan status.
- Active trade rail: reference entry, stop and three R-based targets.
- Historical T3 rails: completed model plans shown in a subdued style to keep the active setup visually prominent.
HOW TO USE RANGEFLOW
Start by selecting the SRBS signal source and sensitivity appropriate to the chart. Review any detected compression range and the ATR trail to understand whether the event is a range resolution, a trail-driven direction change, or both.
When an L or S signal appears, compare its direction with the higher-timeframe structure and market regime. A trending context can still produce losing signals, and a countertrend signal can still work; the panel is intended to expose those conditions rather than make the decision for the user.
If visual trade planning is enabled, examine the proposed stop against the actual price structure. Select Structure, ATR, Auto or a fixed-distance method according to the instrument and your risk framework. Optional position sizing can then provide a starting quantity estimate, subject to broker verification.
SIGNALS, ALERTS AND REPAINTING
Alert conditions are available for SRBS long/short signals and for visual-plan target touches, stop events, completion and reversals. Visual-plan alerts describe model events, not confirmed brokerage fills.
Require Candle Close is OFF by default. This allows SRBS tags and alerts to respond during an unfinished candle; such signals can change or disappear before the candle closes. Enable Require Candle Close and use Once Per Bar Close alerts when closed-candle confirmation is preferred. Visual plans begin only on confirmed signal-bar closes.
The default higher-timeframe structure and EMA references use previously completed higher-timeframe bars. Enabling Use Developing HTF Structure permits those context readings and warnings to change during the higher-timeframe candle. Confirmed pivot structure also carries a natural delay. Historical charts may therefore look more stable than signals observed live with provisional settings enabled.
LIMITATIONS AND DISCLAIMER
SRBS Rangeflow is an indicator with an illustrative trading model, not an automated execution system or a verified TradingView strategy backtest. Simulated entries assume the signal candle's close. Results are estimated from chart OHLC prices and do not account for spread, commission, slippage, order-book depth, gaps, rejected orders, financing costs, margin or broker-specific execution rules.
The market-regime classifications, higher-timeframe readings, estimated quantities and projected risk/reward levels should be treated as analytical references. No component predicts future prices or guarantees that a trade will be profitable. Settings, symbol specifications, timeframes and the available historical data can change the modelled results.
For chart analysis and educational use. Traders remain responsible for independent risk management and execution decisions.
Sorry I haven't published a script for a while. Life has been keeping me busy, lol. In between everything else, I've been working on SRBS Rangeflow. I'm pleased to finally share it with the TradingView community.
OVERVIEW
SRBS stands for Smart Range Breakout System. Rangeflow is a price-chart indicator that combines volatility-compression and range analysis, an ATR-based directional trail, higher-timeframe market context, and a configurable three-target trade-planning model.
The objective is to provide a consistent way to read a directional event: where it originated, whether the surrounding market structure supports it, and how a possible entry, stop and set of targets would look on the chart. Signal generation and context assessment are deliberately separate. A bearish context reading does not remove a bullish SRBS signal, and a favourable reading does not automatically qualify it as a trade.
The display uses compact long/short tags, a trend cloud, a small context panel and optional risk/reward rails. The aim is to retain useful information without overwhelming the price chart.
CONCEPTUAL FRAMEWORK
Rangeflow is built around three connected functions:
1. DETECTION - Identify volatility compression and validate a price range using repeated interaction with its boundaries. A separate ATR trailing model tracks changes in directional state.
2. CONTEXT - Describe higher-timeframe structure, directional efficiency, trend strength and smoothed price behaviour around each SRBS event.
3. PLANNING - Translate a confirmed event into a visual entry, stop and three risk-based targets, with optional position-sizing estimates and simulated outcome tracking.
Each function has a distinct role. The context panel is an interpretation tool rather than a second entry engine, while the trade-planning layer is a visual simulation rather than an order-management system.
RANGE DETECTION AND SIGNAL FOUNDATION
The range engine begins by comparing current Average True Range (ATR) with an average of recent ATR values. A compression condition must persist for a minimum number of bars before a range candidate can qualify.
Potential upper and lower boundaries are estimated from rolling high and low price percentiles. With structure validation enabled, the script also examines:
- Boundary interactions: how often candles reach the tolerance area around each edge.
- Midpoint rotations: how often closing prices cross the range midpoint.
- Containment: the proportion of closes that remain between the candidate boundaries.
- Range width: whether the calculated upper and lower levels form a meaningful price interval.
Once qualified, the range boundaries are held as references until the range resolves. A bullish or bearish range event occurs when an EMA-smoothed typical-price series crosses the corresponding boundary.
Alongside the range engine, the ATR step trail maintains a directional state. Its step-like stop adjusts with the prevailing direction and can change state when price crosses the prior trail or a qualified range breakout establishes a new direction. This gives Rangeflow both consolidation-break and trend-transition information.
SIGNAL LOGIC
The Signal Source setting controls which events generate the L and S tags:
- Original Trend Flips (default): directional changes in the combined SRBS trend state.
- ATR Trail Flips Only: trend changes caused by the trailing model, excluding range-break events.
- Range Breakouts Only: qualifying crosses of established range boundaries.
- Both Separate Events: ATR trail flips and range breakouts as separate signal types.
Aggressive, Balanced and Conservative presets adjust the compression lookback, minimum compression duration and ATR trail multiplier. Custom mode exposes those sensitivity settings directly. A configurable signal cooldown controls the minimum spacing between qualifying events.
Green L tags indicate bullish SRBS events; red S tags indicate bearish events. Amber lettering warns when the nearest available higher-timeframe structure is not supportive or is unclear. It does not remove the underlying signal.
MARKET CONTEXT
The optional context panel presents several complementary measurements:
Higher-timeframe structure
Confirmed swing highs and lows are compared to assess directional structure. The default references are 5m, 15m and 1H, with 4H available as a fallback when the shorter references are not higher than the chart timeframe. The panel derives a weighted directional assessment from eligible timeframes. Pivot confirmation introduces an intentional delay.
Market regime
A 0-100 conditions score blends four measurements: ADX trend strength (35%), price efficiency (30%), EMA separation relative to ATR (20%), and ATR activity relative to its baseline (15%). Readings are grouped as CHOP (below 50), DEVELOPING (50 to below 65), or TRENDING (65 and above). This is a description of price behaviour, not a probability of trade success. On chart timeframes below five minutes, the score uses the previous completed five-minute bar.
Gaussian and HTF reference
A Gaussian-weighted moving centreline gives a smoothed view of price direction. A separate comparison of the previous completed higher-timeframe close with its EMA supplies broader directional context. These measurements are advisory and do not create or veto SRBS signals.
Recent-signal assessment
The panel relates the latest SRBS signal to the available structure and regime readings. Examples include CHOP RISK, COUNTERTREND, HTF UNCERTAIN, and ALIGNED / TRENDING. These are descriptive observations, not trading instructions.
VISUAL TRADE PLANNING
When visual plans are enabled, a confirmed SRBS signal can begin a simulated plan using the signal candle's closing price as the reference entry. Only one plan is tracked at a time.
The default stop method is Structure. For long plans, it references the lowest low of the selected number of preceding completed bars; for short plans, it references the highest high. An ATR buffer is added beyond that level and a minimum ATR stop distance is enforced. The stop is not capped in a way that would deliberately pull it back inside the selected structure.
Other available stop methods are:
- Auto: ATR-based distance that adapts to the instrument's current volatility, with market-appropriate distance labels.
- ATR: user-selected ATR period and multiplier.
- Ticks: a fixed number of the chart symbol's minimum price increments.
- Pips: a fixed pip distance, with automatic conventional forex pip sizing and a manual override.
- Percent: a fixed percentage of the reference entry price.
Auto adjusts the stop distance through ATR; it does not automatically identify structural highs and lows. Structure is a separate, selectable method. Pip sizes, point values and trading increments may differ across broker feeds, especially for metals and CFDs.
The entry-to-stop distance is defined as 1R. Three target levels are projected using adjustable multiples of that distance. The default settings are T1 = 0.5R, T2 = 1.0R and T3 = 1.5R. Prices are rounded to the symbol's minimum tick, and target ordering is preserved after rounding.
The active plan shows entry, stop and target price rails, with lightly shaded risk and reward areas. These levels are mathematical projections; they are not inferred liquidity pools or predicted destinations.
OPTIONAL RISK-BASED POSITION SIZING
Position sizing is disabled by default. When enabled, the user can specify an account balance and a risk percentage or enter a fixed cash-risk budget.
The quantity estimate uses the entry-to-stop distance, the instrument's point value and an account-currency conversion where available. It rounds down to a configurable quantity increment and reports when the required instrument or exchange-rate information is unavailable, or when the calculated size is below the minimum increment.
Depending on the chart symbol, the display may express quantity as contracts, lots, shares or units. Broker specifications and margin requirements must be checked independently. The script cannot read an account balance, place orders or guarantee that actual losses will remain within the displayed budget.
TRADE-PLAN MANAGEMENT AND HISTORICAL RESULTS
For modelled outcomes, each plan is divided into three equal portions, one assigned to each target. When price touches a target, that portion is recorded at its corresponding R multiple. If price reaches the stop, any uncompleted portions are treated as stopped.
Reverse Plan on Opposite Signal is enabled by default. A confirmed opposite SRBS signal can close the remaining simulated portions at that candle's close and start a new plan in the other direction. If the stop or final target was reached on the same candle, that event takes priority over the reversal. The feature can be disabled to hold the current plan until it reaches its stop or final target.
When Keep Completed T3 Plans is enabled, fully completed three-target plans remain visible as understated historical entry, stop and target rails with one compact completion tag. Five completed T3 plans are retained by default, with a configurable maximum. Stopped, partially completed and reversed plans can retain result labels, allowing outcomes other than full target completions to remain visible.
The model offers a Stop First / Targets First setting for bars whose high-low range includes both an exit target and the stop. Stop First is the default conservative assumption. Historical candle data cannot establish the actual sequence of every intrabar touch.
CHART INTERPRETATION
- Compression range: a dashed boundary box marking the detected consolidation structure.
- SRBS centre, trail and cloud: the reference average, step-trailing level and directional background between them.
- L / S tags: bullish and bearish events from the selected SRBS signal source.
- Amber tag lettering: caution regarding the nearest available higher-timeframe structure.
- Context panel: structure, regime, smoothed/HTF direction, recent signal and simulated-plan status.
- Active trade rail: reference entry, stop and three R-based targets.
- Historical T3 rails: completed model plans shown in a subdued style to keep the active setup visually prominent.
HOW TO USE RANGEFLOW
Start by selecting the SRBS signal source and sensitivity appropriate to the chart. Review any detected compression range and the ATR trail to understand whether the event is a range resolution, a trail-driven direction change, or both.
When an L or S signal appears, compare its direction with the higher-timeframe structure and market regime. A trending context can still produce losing signals, and a countertrend signal can still work; the panel is intended to expose those conditions rather than make the decision for the user.
If visual trade planning is enabled, examine the proposed stop against the actual price structure. Select Structure, ATR, Auto or a fixed-distance method according to the instrument and your risk framework. Optional position sizing can then provide a starting quantity estimate, subject to broker verification.
SIGNALS, ALERTS AND REPAINTING
Alert conditions are available for SRBS long/short signals and for visual-plan target touches, stop events, completion and reversals. Visual-plan alerts describe model events, not confirmed brokerage fills.
Require Candle Close is OFF by default. This allows SRBS tags and alerts to respond during an unfinished candle; such signals can change or disappear before the candle closes. Enable Require Candle Close and use Once Per Bar Close alerts when closed-candle confirmation is preferred. Visual plans begin only on confirmed signal-bar closes.
The default higher-timeframe structure and EMA references use previously completed higher-timeframe bars. Enabling Use Developing HTF Structure permits those context readings and warnings to change during the higher-timeframe candle. Confirmed pivot structure also carries a natural delay. Historical charts may therefore look more stable than signals observed live with provisional settings enabled.
LIMITATIONS AND DISCLAIMER
SRBS Rangeflow is an indicator with an illustrative trading model, not an automated execution system or a verified TradingView strategy backtest. Simulated entries assume the signal candle's close. Results are estimated from chart OHLC prices and do not account for spread, commission, slippage, order-book depth, gaps, rejected orders, financing costs, margin or broker-specific execution rules.
The market-regime classifications, higher-timeframe readings, estimated quantities and projected risk/reward levels should be treated as analytical references. No component predicts future prices or guarantees that a trade will be profitable. Settings, symbol specifications, timeframes and the available historical data can change the modelled results.
For chart analysis and educational use. Traders remain responsible for independent risk management and execution decisions.
ملاحظات الأخبار
bug fix and improvementsimproved trade plan qualification with 4 filter confirmation (HTF, regime, Gaussian and EMA). added adjustable 4/4 and 3/4 modes, plus dashboard feedback. Original signals remain unchanged.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.