OPEN-SOURCE SCRIPT
Barrier Option-Style Breakout Indicator [v1]

The Barrier Option-Style Breakout Indicator is a path-dependent breakout tool inspired by barrier option logic.
In barrier options, the path of price matters. It is not enough to know where price ends. What matters is whether price touched, breached, activated, retested, or failed around a specific barrier level.
This indicator applies that same idea to breakout trading.
Instead of only asking whether price is above resistance or below support, the indicator asks:
• Has price reached the barrier?
• Has the barrier been confirmed?
• Did the breakout pass volatility and volume quality filters?
• Did price retest the barrier and hold?
• Did price fail back inside the range?
• Is the breakout active, weak, confirmed, or failed?
This is not a simple buy or sell signal indicator.
It is a breakout-quality and path-dependency framework designed to help traders evaluate whether a breakout has enough structure, confirmation, and follow-through.
The indicator can be used across FX, crypto, indices, commodities, futures, and liquid stocks.
WHAT THE INDICATOR DOES
━━━━━━━━━━━━━━━━━━━━━━
The indicator creates upper and lower barrier levels.
These barriers can be based on:
• Recent range high and range low
• Manual user-defined levels
• Expected-move levels
Once a barrier is touched or breached, the script tracks what happens next.
It classifies the market into states such as:
• Neutral
• Weak upper breach
• Weak lower breach
• Bullish knock-in
• Bearish knock-in
• Bullish retest confirmed
• Bearish retest confirmed
• Bullish barrier failed
• Bearish barrier failed
The key advantage is that the indicator remembers the active barrier and monitors the post-breakout path.
This makes it more useful than a simple horizontal breakout line.
CORE IDEA
━━━━━━━━━━━━━━━━━━━━━━
A normal breakout indicator usually checks whether price has crossed a level.
This indicator goes further.
It treats the breakout level as a barrier.
Once price activates the barrier, the indicator tracks whether the breakout becomes more credible or fails.
The logic is:
1. Define the upper and lower barriers.
2. Watch for price to touch or close beyond a barrier.
3. Apply breakout confirmation rules.
4. Check volatility and volume quality filters.
5. Track the active barrier after breakout.
6. Watch for a retest.
7. Watch for a failure back inside the barrier.
8. Classify the current market state.
This gives the trader a more complete breakout map.
MAIN COMPONENTS
━━━━━━━━━━━━━━━━━━━━━━
1. Barrier Mode
The script includes three barrier modes:
• Range High/Low
• Manual
• Expected Move
Range High/Low uses the recent highest high and lowest low over the selected lookback period.
Manual allows the trader to enter custom upper and lower barrier levels.
Expected Move creates dynamic barriers using volatility and expected-move logic.
Range High/Low is usually best for technical breakout trading.
Manual is useful for major levels, event levels, round numbers, or externally defined support and resistance.
Expected Move is useful for volatility-adjusted breakout analysis.
2. Range Lookback
When using Range High/Low mode, the range lookback determines how many bars are used to calculate the upper and lower barriers.
A shorter lookback creates more reactive barriers.
A longer lookback creates more important, but slower-moving barriers.
For intraday trading, 30 to 80 bars can be useful.
For swing trading, 50 to 200 bars may be more appropriate.
3. Manual Barriers
Manual mode allows the trader to input a specific upper and lower barrier.
This is useful when the trader already knows the key levels.
Examples include:
• Previous day high
• Previous day low
• Weekly high
• Weekly low
• Major support
• Major resistance
• Round number
• Event anchor level
• Liquidity zone
4. Expected Move Barriers
Expected Move mode calculates barriers using volatility.
The indicator estimates expected movement over a selected horizon and places the upper and lower barriers around the anchor price.
This mode is useful when the trader wants breakout levels to adapt to current volatility.
If volatility is high, the expected-move barriers widen.
If volatility is low, the expected-move barriers narrow.
5. Breakout Confirmation
The script includes three confirmation modes:
• Touch Barrier
• Close Beyond Barrier
• Close + Buffer
Touch Barrier is the most sensitive.
Close Beyond Barrier requires the candle to close beyond the barrier.
Close + Buffer requires price to close beyond the barrier by an additional buffer.
Close + Buffer is the strictest and usually the best setting for reducing false breakouts.
6. Breakout Buffer
The breakout buffer helps reduce false signals.
The buffer can be based on:
• ATR
• Percent
• Ticks
ATR buffer is generally the most adaptive because it scales with current market volatility.
For example, a 0.25 ATR buffer means price must close beyond the barrier by 25% of the current ATR.
7. Retest Logic
After a breakout, price often returns to test the breakout level.
The indicator can monitor whether price retests the active barrier and holds.
A bullish retest is confirmed when price breaks above the upper barrier, returns toward that barrier, and holds above it.
A bearish retest is confirmed when price breaks below the lower barrier, returns toward that barrier, and holds below it.
This is useful because many traders prefer to enter after a breakout retest rather than on the initial breakout candle.
8. Retest Window
The retest window controls how many bars after the breakout the indicator will monitor for a valid retest.
A short window is stricter.
A longer window gives price more time to return to the barrier.
For intraday trading, 8 to 24 bars can be useful.
For swing trading, 20 to 50 bars may be more appropriate.
9. Retest Tolerance
The retest tolerance controls how close price must come to the active barrier to qualify as a retest.
The tolerance can be based on:
• ATR
• Percent
• Ticks
ATR tolerance is usually the best default because it adapts to volatility.
10. Failure Logic
A failed breakout occurs when price breaks the barrier but then returns back inside the prior range.
For a bullish breakout, failure occurs when price breaks above the upper barrier but then closes back below the active barrier.
For a bearish breakout, failure occurs when price breaks below the lower barrier but then closes back above the active barrier.
Failure detection is important because failed breakouts can produce strong reversal moves.
11. Quality Filters
The script includes volatility and volume quality filters.
The volatility filter checks whether volatility percentile is high enough to support a quality breakout.
The volume filter checks whether current volume is elevated relative to average volume.
A breakout that passes both filters is treated as stronger.
A breakout that breaches the barrier but fails the quality filters is marked as a weak breach.
12. Barrier Hit Probability Proxy
The indicator includes a simple barrier hit probability estimate.
This is not a full barrier option first-passage model.
It is a simplified approximation based on:
• Distance to the barrier
• Expected move
• Selected barrier sigma
It gives a rough sense of how close price is to the upper or lower barrier in volatility-adjusted terms.
HOW TO READ THE INDICATOR
━━━━━━━━━━━━━━━━━━━━━━
The indicator plots barrier levels on the price chart.
Visual guide:
• Green line = Upper Barrier
• Red line = Lower Barrier
• Faded green line = Upper confirmation level when buffer is enabled
• Faded red line = Lower confirmation level when buffer is enabled
• White line = Active Barrier after breakout activation
Signal labels show:
• Knock-In
• Weak
• Retest
• Fail
A Knock-In signal means the barrier breakout has been activated.
A Weak signal means the barrier was breached, but quality filters failed.
A Retest signal means price returned to the active barrier and held.
A Fail signal means price broke the barrier but failed back inside.
The dashboard shows:
• Market State
• Barrier Mode
• Upper Barrier
• Lower Barrier
• Active Barrier
• Bars Since Breakout
• Volatility Percentile
• Volume Ratio
• Quality Filter
• Probability Hit Upper
• Probability Hit Lower
MARKET STATE DEFINITIONS
━━━━━━━━━━━━━━━━━━━━━━
Neutral
Neutral means no active confirmed breakout state is present.
Price may be trading inside the range or near a barrier without confirmation.
Weak Upper Breach
A weak upper breach occurs when price breaches the upper barrier, but the quality filters do not pass.
This suggests the upside breakout may lack volatility or volume support.
Weak Lower Breach
A weak lower breach occurs when price breaches the lower barrier, but the quality filters do not pass.
This suggests the downside breakout may lack volatility or volume support.
Bullish Knock-In
Bullish Knock-In means the upper barrier has been activated by a confirmed bullish breakout.
This suggests upside breakout conditions are active.
Bearish Knock-In
Bearish Knock-In means the lower barrier has been activated by a confirmed bearish breakout.
This suggests downside breakout conditions are active.
Bullish Retest Confirmed
Bullish Retest Confirmed means price broke above the upper barrier, returned to retest it, and held above it.
This is often a higher-quality bullish continuation condition than the initial breakout candle alone.
Bearish Retest Confirmed
Bearish Retest Confirmed means price broke below the lower barrier, returned to retest it, and held below it.
This is often a higher-quality bearish continuation condition than the initial breakdown candle alone.
Bullish Barrier Failed
Bullish Barrier Failed means price broke above the upper barrier but then failed back below the active barrier.
This may indicate a failed breakout, bull trap, liquidity sweep, or exhaustion move.
Bearish Barrier Failed
Bearish Barrier Failed means price broke below the lower barrier but then failed back above the active barrier.
This may indicate a failed breakdown, bear trap, liquidity sweep, or exhaustion move.
HOW TO USE THE INDICATOR
━━━━━━━━━━━━━━━━━━━━━━
Use this indicator as a breakout-quality framework.
The script is designed to help answer:
• Where are the active breakout barriers?
• Has price breached the barrier?
• Did the breach pass quality filters?
• Has the breakout retested and held?
• Has the breakout failed back inside?
• Is the breakout worth following or should it be avoided?
The indicator should not be used alone for trade entries.
Use it with market structure, trend, liquidity, volatility regime, expected-move levels, and risk management.
PRACTICAL TRADING WORKFLOW
━━━━━━━━━━━━━━━━━━━━━━
1. Choose the barrier mode.
Use Range High/Low for normal breakout trading.
Use Manual for known levels.
Use Expected Move for volatility-adjusted breakout zones.
2. Choose confirmation mode.
Use Close Beyond Barrier for balanced confirmation.
Use Close + Buffer for stricter breakout confirmation.
Use Touch Barrier only for aggressive or early-warning use.
3. Check quality filters.
A breakout is stronger when volatility and volume filters pass.
A weak breach should be treated with caution.
4. Watch the active barrier.
After a breakout, the active barrier becomes the key reference level.
For bullish breakouts, the upper barrier becomes the key support test.
For bearish breakouts, the lower barrier becomes the key resistance test.
5. Wait for retest if needed.
Conservative traders may wait for Retest Confirmed before entering.
This can reduce chasing risk after the initial breakout candle.
6. Watch for failure.
If price returns back inside the barrier within the failure window, the breakout has failed.
Failed breakouts can become reversal opportunities, but they still require confirmation.
7. Manage risk.
Breakouts can be volatile.
Do not use the signal without stop-loss planning, position sizing, and reward-to-risk evaluation.
BREAKOUT INTERPRETATION
━━━━━━━━━━━━━━━━━━━━━━
Bullish Breakout Setup
A higher-quality bullish breakout may include:
• Price breaks above the upper barrier
• Confirmation mode is satisfied
• Volatility filter passes
• Volume filter passes
• Price holds above the active barrier
• Retest is confirmed
• Higher-timeframe structure supports upside
Bearish Breakout Setup
A higher-quality bearish breakout may include:
• Price breaks below the lower barrier
• Confirmation mode is satisfied
• Volatility filter passes
• Volume filter passes
• Price holds below the active barrier
• Retest is confirmed
• Higher-timeframe structure supports downside
Weak Breakout
A weak breakout may occur when:
• Price breaches the barrier but volume is low
• Volatility percentile is too low
• Price fails to close beyond the buffer
• Price immediately returns inside the range
• Breakout occurs into major opposing structure
Failed Breakout
A failed breakout may occur when:
• Price breaks the barrier
• Traders chase the breakout
• Price reverses back inside the barrier
• The active barrier fails to hold
• The market traps breakout traders
Failed breakouts should not be ignored. They often contain useful information about liquidity and positioning.
SUGGESTED SETTINGS
━━━━━━━━━━━━━━━━━━━━━━
FX 1-Hour
• Barrier Mode: Range High/Low
• Range Lookback Bars: 50
• Breakout Confirmation: Close + Buffer
• Buffer Mode: ATR
• ATR Buffer Multiplier: 0.20 to 0.35
• Retest Window Bars: 12 to 24
• Failure Window Bars: 12 to 24
• Volatility Filter: True
• Minimum Vol Percentile: 50
• Volume Filter: False or True depending on broker volume quality
• Bars Per Year: 6240
Crypto 1-Hour
• Barrier Mode: Range High/Low
• Range Lookback Bars: 50 to 100
• Breakout Confirmation: Close + Buffer
• ATR Buffer Multiplier: 0.25 to 0.50
• Retest Window Bars: 24
• Failure Window Bars: 24
• Volatility Filter: True
• Volume Filter: True
• Minimum Volume Ratio: 1.20
• Bars Per Year: 8760
Indices 15-Minute or 1-Hour
• Barrier Mode: Range High/Low
• Range Lookback Bars: 30 to 80
• Breakout Confirmation: Close + Buffer
• ATR Buffer Multiplier: 0.20 to 0.40
• Retest Window Bars: 8 to 20
• Failure Window Bars: 8 to 20
• Volatility Filter: True
• Volume Filter: True
Daily Equities
• Barrier Mode: Range High/Low or Manual
• Range Lookback Bars: 50 to 100
• Breakout Confirmation: Close Beyond Barrier or Close + Buffer
• ATR Buffer Multiplier: 0.20 to 0.50
• Retest Window Bars: 5 to 20
• Failure Window Bars: 5 to 20
• Volatility Filter: True
• Volume Filter: True
• Bars Per Year: 252
BARRIER MODE GUIDE
━━━━━━━━━━━━━━━━━━━━━━
Range High/Low
This mode calculates the upper and lower barriers from the recent price range.
Best for:
• Breakout trading
• Range expansion setups
• Support and resistance breaks
• Consolidation breakouts
Manual
Manual mode allows the trader to define the upper and lower barriers.
Best for:
• Key technical levels
• Previous day high/low
• Weekly high/low
• Round numbers
• Event levels
• Liquidity zones
Expected Move
Expected Move mode creates volatility-adjusted barriers.
Best for:
• Volatility-based breakout analysis
• Event-risk planning
• Comparing price movement to expected range
• Adaptive barrier levels
CONFIRMATION MODE GUIDE
━━━━━━━━━━━━━━━━━━━━━━
Touch Barrier
This mode triggers as soon as price touches the barrier.
It is the most sensitive setting.
Best for early warning, but it will produce more false signals.
Close Beyond Barrier
This mode requires the candle to close beyond the barrier.
It is more reliable than simple touch logic.
This is a balanced setting.
Close + Buffer
This mode requires price to close beyond the barrier by an additional buffer.
It is the strictest setting.
Best for reducing false breakouts.
RETEST LOGIC GUIDE
━━━━━━━━━━━━━━━━━━━━━━
A retest occurs when price breaks the barrier and then returns to test it.
For bullish breakouts, the upper barrier should ideally act as support.
For bearish breakouts, the lower barrier should ideally act as resistance.
Retest confirmation can help traders avoid chasing the initial breakout candle.
However, not all strong breakouts retest.
A very strong breakout may continue without giving a clean retest.
FAILURE LOGIC GUIDE
━━━━━━━━━━━━━━━━━━━━━━
A breakout failure occurs when price breaks the barrier but then returns back inside the active barrier.
This can be important because failed breakouts often indicate trapped positioning.
A bullish breakout failure can suggest:
• Bull trap
• Liquidity sweep above resistance
• Failed upside continuation
• Potential reversal risk
A bearish breakout failure can suggest:
• Bear trap
• Liquidity sweep below support
• Failed downside continuation
• Potential reversal risk
Failure signals should still be confirmed with price structure and risk management.
HOW TO COMBINE WITH OTHER INDICATORS
━━━━━━━━━━━━━━━━━━━━━━
This indicator works best as part of a broader volatility and market-structure framework.
Useful combinations:
• Expected Move Bands
• Realized Volatility Regime Indicator
• Implied Volatility Proxy
• Delta-Hedging Pressure Proxy
• Dynamic Stop-Loss Using Expected Move
• Risk-Neutral Probability Cone
• VWAP
• Moving averages
• Support and resistance
• Liquidity zones
• Market structure breaks
• Macro and event calendars
Suggested framework:
Expected Move Bands show near-term volatility-adjusted levels.
Realized Volatility Regime shows whether volatility is low, normal, high, or extreme.
IV Proxy shows whether broader uncertainty is rising or cooling.
Delta-Hedging Pressure Proxy shows whether directional pressure is positive or negative.
Dynamic Stop-Loss converts volatility into risk levels.
Risk-Neutral Probability Cone maps forward probability ranges.
Barrier Option-Style Breakout Indicator tracks whether price has activated, confirmed, retested, or failed a breakout barrier.
Together, these tools help answer:
• Where are the breakout levels?
• Has price activated the barrier?
• Is the breakout high quality or weak?
• Has the breakout retested and held?
• Has the breakout failed?
• How far can price reasonably move?
• Where should stops and targets be placed?
• Should position size be reduced?
TRADING EXAMPLES
━━━━━━━━━━━━━━━━━━━━━━
Example 1: Bullish Knock-In
Price breaks above the upper barrier.
The dashboard shows:
• Market State: Bullish Knock-In
• Quality Filter: Pass
• Volatility Percentile: above threshold
• Volume Ratio: above threshold
This suggests that the upside breakout has been activated and supported by quality conditions.
A trader may look for continuation, but should still manage risk carefully.
Example 2: Bullish Retest Confirmed
Price breaks above the upper barrier, then returns to retest the barrier and holds above it.
The dashboard shows:
• Market State: Bullish Retest Confirmed
This is often a stronger continuation setup than the initial breakout candle.
A trader may use the active barrier as a key invalidation reference.
Example 3: Weak Upper Breach
Price moves above the upper barrier, but the quality filter fails.
The dashboard shows:
• Market State: Weak Upper Breach
• Quality Filter: Fail
This suggests caution.
The breakout may not have enough volatility or volume support.
Example 4: Bullish Barrier Failed
Price breaks above the upper barrier but then closes back below the active barrier.
The dashboard shows:
• Market State: Bullish Barrier Failed
This may indicate a bull trap, failed breakout, or liquidity sweep.
A trader should avoid assuming continuation unless price reclaims the barrier.
Example 5: Bearish Retest Confirmed
Price breaks below the lower barrier, then retests the barrier from below and fails to reclaim it.
The dashboard shows:
• Market State: Bearish Retest Confirmed
This suggests downside breakout structure remains valid.
A trader may use the active barrier as a resistance and invalidation reference.
RISK MANAGEMENT NOTES
━━━━━━━━━━━━━━━━━━━━━━
Breakout strategies can suffer from false signals.
This indicator helps reduce that risk by separating:
• Weak breaches
• Confirmed knock-ins
• Retest confirmations
• Failed breakouts
Practical risk rules:
• Do not chase every knock-in candle
• Treat weak breaches with caution
• Wait for retest confirmation if chasing risk is high
• Use failed breakout signals as risk warnings
• Use the active barrier as an invalidation reference
• Reduce size in high-volatility conditions
• Do not rely on volume filters when the asset has poor volume data
• Combine with expected move and dynamic stop tools
A breakout is not automatically valid because price crossed a line.
The path after the breakout matters.
WHAT THIS INDICATOR IS BEST FOR
━━━━━━━━━━━━━━━━━━━━━━
This indicator is best used for:
• Breakout quality assessment
• Range breakout tracking
• Barrier activation logic
• Retest confirmation
• Failed breakout detection
• Liquidity sweep awareness
• Event-level breakout monitoring
• Support and resistance breakout analysis
• Volatility-adjusted breakout levels
• Trade planning and risk management
It is useful for traders who want more structure than a basic support/resistance breakout signal.
WHAT THIS INDICATOR IS NOT
━━━━━━━━━━━━━━━━━━━━━━
This indicator is not:
• A standalone trading strategy
• A guaranteed breakout system
• A buy or sell signal generator
• A true barrier option pricing model
• A full first-passage probability model
• A replacement for risk management
• A replacement for market structure
• A complete trading system
The indicator identifies breakout states.
It does not guarantee continuation.
IMPORTANT LIMITATIONS
━━━━━━━━━━━━━━━━━━━━━━
The indicator uses price, volatility, range, and volume data.
It does not include:
• Order flow
• Market depth
• Dealer positioning
• Options open interest
• Real barrier option pricing
• News sentiment
• Fundamental data
• Liquidity conditions
The probability estimate is simplified.
It is not a full barrier option first-passage model.
Volume quality may differ across markets.
For example:
• FX broker volume is usually tick volume
• Crypto volume depends on exchange feed
• Equities and futures volume are generally more reliable
• Indices may use synthetic or broker-dependent volume
Breakouts can fail even when quality filters pass.
The indicator should be used as a decision-support tool, not as a standalone system.
FINAL NOTES
━━━━━━━━━━━━━━━━━━━━━━
The Barrier Option-Style Breakout Indicator helps traders think about breakouts as path-dependent events.
Instead of asking only whether price crossed a level, the tool helps answer:
• Did price activate the barrier?
• Was the breakout strong or weak?
• Did volatility and volume support the move?
• Did price retest the barrier?
• Did the barrier hold?
• Did the breakout fail?
• Is the active barrier now the key invalidation level?
The indicator is designed to improve breakout discipline, reduce emotional chasing, and provide a structured way to monitor breakout behaviour.
In barrier options, the path of price matters. It is not enough to know where price ends. What matters is whether price touched, breached, activated, retested, or failed around a specific barrier level.
This indicator applies that same idea to breakout trading.
Instead of only asking whether price is above resistance or below support, the indicator asks:
• Has price reached the barrier?
• Has the barrier been confirmed?
• Did the breakout pass volatility and volume quality filters?
• Did price retest the barrier and hold?
• Did price fail back inside the range?
• Is the breakout active, weak, confirmed, or failed?
This is not a simple buy or sell signal indicator.
It is a breakout-quality and path-dependency framework designed to help traders evaluate whether a breakout has enough structure, confirmation, and follow-through.
The indicator can be used across FX, crypto, indices, commodities, futures, and liquid stocks.
WHAT THE INDICATOR DOES
━━━━━━━━━━━━━━━━━━━━━━
The indicator creates upper and lower barrier levels.
These barriers can be based on:
• Recent range high and range low
• Manual user-defined levels
• Expected-move levels
Once a barrier is touched or breached, the script tracks what happens next.
It classifies the market into states such as:
• Neutral
• Weak upper breach
• Weak lower breach
• Bullish knock-in
• Bearish knock-in
• Bullish retest confirmed
• Bearish retest confirmed
• Bullish barrier failed
• Bearish barrier failed
The key advantage is that the indicator remembers the active barrier and monitors the post-breakout path.
This makes it more useful than a simple horizontal breakout line.
CORE IDEA
━━━━━━━━━━━━━━━━━━━━━━
A normal breakout indicator usually checks whether price has crossed a level.
This indicator goes further.
It treats the breakout level as a barrier.
Once price activates the barrier, the indicator tracks whether the breakout becomes more credible or fails.
The logic is:
1. Define the upper and lower barriers.
2. Watch for price to touch or close beyond a barrier.
3. Apply breakout confirmation rules.
4. Check volatility and volume quality filters.
5. Track the active barrier after breakout.
6. Watch for a retest.
7. Watch for a failure back inside the barrier.
8. Classify the current market state.
This gives the trader a more complete breakout map.
MAIN COMPONENTS
━━━━━━━━━━━━━━━━━━━━━━
1. Barrier Mode
The script includes three barrier modes:
• Range High/Low
• Manual
• Expected Move
Range High/Low uses the recent highest high and lowest low over the selected lookback period.
Manual allows the trader to enter custom upper and lower barrier levels.
Expected Move creates dynamic barriers using volatility and expected-move logic.
Range High/Low is usually best for technical breakout trading.
Manual is useful for major levels, event levels, round numbers, or externally defined support and resistance.
Expected Move is useful for volatility-adjusted breakout analysis.
2. Range Lookback
When using Range High/Low mode, the range lookback determines how many bars are used to calculate the upper and lower barriers.
A shorter lookback creates more reactive barriers.
A longer lookback creates more important, but slower-moving barriers.
For intraday trading, 30 to 80 bars can be useful.
For swing trading, 50 to 200 bars may be more appropriate.
3. Manual Barriers
Manual mode allows the trader to input a specific upper and lower barrier.
This is useful when the trader already knows the key levels.
Examples include:
• Previous day high
• Previous day low
• Weekly high
• Weekly low
• Major support
• Major resistance
• Round number
• Event anchor level
• Liquidity zone
4. Expected Move Barriers
Expected Move mode calculates barriers using volatility.
The indicator estimates expected movement over a selected horizon and places the upper and lower barriers around the anchor price.
This mode is useful when the trader wants breakout levels to adapt to current volatility.
If volatility is high, the expected-move barriers widen.
If volatility is low, the expected-move barriers narrow.
5. Breakout Confirmation
The script includes three confirmation modes:
• Touch Barrier
• Close Beyond Barrier
• Close + Buffer
Touch Barrier is the most sensitive.
Close Beyond Barrier requires the candle to close beyond the barrier.
Close + Buffer requires price to close beyond the barrier by an additional buffer.
Close + Buffer is the strictest and usually the best setting for reducing false breakouts.
6. Breakout Buffer
The breakout buffer helps reduce false signals.
The buffer can be based on:
• ATR
• Percent
• Ticks
ATR buffer is generally the most adaptive because it scales with current market volatility.
For example, a 0.25 ATR buffer means price must close beyond the barrier by 25% of the current ATR.
7. Retest Logic
After a breakout, price often returns to test the breakout level.
The indicator can monitor whether price retests the active barrier and holds.
A bullish retest is confirmed when price breaks above the upper barrier, returns toward that barrier, and holds above it.
A bearish retest is confirmed when price breaks below the lower barrier, returns toward that barrier, and holds below it.
This is useful because many traders prefer to enter after a breakout retest rather than on the initial breakout candle.
8. Retest Window
The retest window controls how many bars after the breakout the indicator will monitor for a valid retest.
A short window is stricter.
A longer window gives price more time to return to the barrier.
For intraday trading, 8 to 24 bars can be useful.
For swing trading, 20 to 50 bars may be more appropriate.
9. Retest Tolerance
The retest tolerance controls how close price must come to the active barrier to qualify as a retest.
The tolerance can be based on:
• ATR
• Percent
• Ticks
ATR tolerance is usually the best default because it adapts to volatility.
10. Failure Logic
A failed breakout occurs when price breaks the barrier but then returns back inside the prior range.
For a bullish breakout, failure occurs when price breaks above the upper barrier but then closes back below the active barrier.
For a bearish breakout, failure occurs when price breaks below the lower barrier but then closes back above the active barrier.
Failure detection is important because failed breakouts can produce strong reversal moves.
11. Quality Filters
The script includes volatility and volume quality filters.
The volatility filter checks whether volatility percentile is high enough to support a quality breakout.
The volume filter checks whether current volume is elevated relative to average volume.
A breakout that passes both filters is treated as stronger.
A breakout that breaches the barrier but fails the quality filters is marked as a weak breach.
12. Barrier Hit Probability Proxy
The indicator includes a simple barrier hit probability estimate.
This is not a full barrier option first-passage model.
It is a simplified approximation based on:
• Distance to the barrier
• Expected move
• Selected barrier sigma
It gives a rough sense of how close price is to the upper or lower barrier in volatility-adjusted terms.
HOW TO READ THE INDICATOR
━━━━━━━━━━━━━━━━━━━━━━
The indicator plots barrier levels on the price chart.
Visual guide:
• Green line = Upper Barrier
• Red line = Lower Barrier
• Faded green line = Upper confirmation level when buffer is enabled
• Faded red line = Lower confirmation level when buffer is enabled
• White line = Active Barrier after breakout activation
Signal labels show:
• Knock-In
• Weak
• Retest
• Fail
A Knock-In signal means the barrier breakout has been activated.
A Weak signal means the barrier was breached, but quality filters failed.
A Retest signal means price returned to the active barrier and held.
A Fail signal means price broke the barrier but failed back inside.
The dashboard shows:
• Market State
• Barrier Mode
• Upper Barrier
• Lower Barrier
• Active Barrier
• Bars Since Breakout
• Volatility Percentile
• Volume Ratio
• Quality Filter
• Probability Hit Upper
• Probability Hit Lower
MARKET STATE DEFINITIONS
━━━━━━━━━━━━━━━━━━━━━━
Neutral
Neutral means no active confirmed breakout state is present.
Price may be trading inside the range or near a barrier without confirmation.
Weak Upper Breach
A weak upper breach occurs when price breaches the upper barrier, but the quality filters do not pass.
This suggests the upside breakout may lack volatility or volume support.
Weak Lower Breach
A weak lower breach occurs when price breaches the lower barrier, but the quality filters do not pass.
This suggests the downside breakout may lack volatility or volume support.
Bullish Knock-In
Bullish Knock-In means the upper barrier has been activated by a confirmed bullish breakout.
This suggests upside breakout conditions are active.
Bearish Knock-In
Bearish Knock-In means the lower barrier has been activated by a confirmed bearish breakout.
This suggests downside breakout conditions are active.
Bullish Retest Confirmed
Bullish Retest Confirmed means price broke above the upper barrier, returned to retest it, and held above it.
This is often a higher-quality bullish continuation condition than the initial breakout candle alone.
Bearish Retest Confirmed
Bearish Retest Confirmed means price broke below the lower barrier, returned to retest it, and held below it.
This is often a higher-quality bearish continuation condition than the initial breakdown candle alone.
Bullish Barrier Failed
Bullish Barrier Failed means price broke above the upper barrier but then failed back below the active barrier.
This may indicate a failed breakout, bull trap, liquidity sweep, or exhaustion move.
Bearish Barrier Failed
Bearish Barrier Failed means price broke below the lower barrier but then failed back above the active barrier.
This may indicate a failed breakdown, bear trap, liquidity sweep, or exhaustion move.
HOW TO USE THE INDICATOR
━━━━━━━━━━━━━━━━━━━━━━
Use this indicator as a breakout-quality framework.
The script is designed to help answer:
• Where are the active breakout barriers?
• Has price breached the barrier?
• Did the breach pass quality filters?
• Has the breakout retested and held?
• Has the breakout failed back inside?
• Is the breakout worth following or should it be avoided?
The indicator should not be used alone for trade entries.
Use it with market structure, trend, liquidity, volatility regime, expected-move levels, and risk management.
PRACTICAL TRADING WORKFLOW
━━━━━━━━━━━━━━━━━━━━━━
1. Choose the barrier mode.
Use Range High/Low for normal breakout trading.
Use Manual for known levels.
Use Expected Move for volatility-adjusted breakout zones.
2. Choose confirmation mode.
Use Close Beyond Barrier for balanced confirmation.
Use Close + Buffer for stricter breakout confirmation.
Use Touch Barrier only for aggressive or early-warning use.
3. Check quality filters.
A breakout is stronger when volatility and volume filters pass.
A weak breach should be treated with caution.
4. Watch the active barrier.
After a breakout, the active barrier becomes the key reference level.
For bullish breakouts, the upper barrier becomes the key support test.
For bearish breakouts, the lower barrier becomes the key resistance test.
5. Wait for retest if needed.
Conservative traders may wait for Retest Confirmed before entering.
This can reduce chasing risk after the initial breakout candle.
6. Watch for failure.
If price returns back inside the barrier within the failure window, the breakout has failed.
Failed breakouts can become reversal opportunities, but they still require confirmation.
7. Manage risk.
Breakouts can be volatile.
Do not use the signal without stop-loss planning, position sizing, and reward-to-risk evaluation.
BREAKOUT INTERPRETATION
━━━━━━━━━━━━━━━━━━━━━━
Bullish Breakout Setup
A higher-quality bullish breakout may include:
• Price breaks above the upper barrier
• Confirmation mode is satisfied
• Volatility filter passes
• Volume filter passes
• Price holds above the active barrier
• Retest is confirmed
• Higher-timeframe structure supports upside
Bearish Breakout Setup
A higher-quality bearish breakout may include:
• Price breaks below the lower barrier
• Confirmation mode is satisfied
• Volatility filter passes
• Volume filter passes
• Price holds below the active barrier
• Retest is confirmed
• Higher-timeframe structure supports downside
Weak Breakout
A weak breakout may occur when:
• Price breaches the barrier but volume is low
• Volatility percentile is too low
• Price fails to close beyond the buffer
• Price immediately returns inside the range
• Breakout occurs into major opposing structure
Failed Breakout
A failed breakout may occur when:
• Price breaks the barrier
• Traders chase the breakout
• Price reverses back inside the barrier
• The active barrier fails to hold
• The market traps breakout traders
Failed breakouts should not be ignored. They often contain useful information about liquidity and positioning.
SUGGESTED SETTINGS
━━━━━━━━━━━━━━━━━━━━━━
FX 1-Hour
• Barrier Mode: Range High/Low
• Range Lookback Bars: 50
• Breakout Confirmation: Close + Buffer
• Buffer Mode: ATR
• ATR Buffer Multiplier: 0.20 to 0.35
• Retest Window Bars: 12 to 24
• Failure Window Bars: 12 to 24
• Volatility Filter: True
• Minimum Vol Percentile: 50
• Volume Filter: False or True depending on broker volume quality
• Bars Per Year: 6240
Crypto 1-Hour
• Barrier Mode: Range High/Low
• Range Lookback Bars: 50 to 100
• Breakout Confirmation: Close + Buffer
• ATR Buffer Multiplier: 0.25 to 0.50
• Retest Window Bars: 24
• Failure Window Bars: 24
• Volatility Filter: True
• Volume Filter: True
• Minimum Volume Ratio: 1.20
• Bars Per Year: 8760
Indices 15-Minute or 1-Hour
• Barrier Mode: Range High/Low
• Range Lookback Bars: 30 to 80
• Breakout Confirmation: Close + Buffer
• ATR Buffer Multiplier: 0.20 to 0.40
• Retest Window Bars: 8 to 20
• Failure Window Bars: 8 to 20
• Volatility Filter: True
• Volume Filter: True
Daily Equities
• Barrier Mode: Range High/Low or Manual
• Range Lookback Bars: 50 to 100
• Breakout Confirmation: Close Beyond Barrier or Close + Buffer
• ATR Buffer Multiplier: 0.20 to 0.50
• Retest Window Bars: 5 to 20
• Failure Window Bars: 5 to 20
• Volatility Filter: True
• Volume Filter: True
• Bars Per Year: 252
BARRIER MODE GUIDE
━━━━━━━━━━━━━━━━━━━━━━
Range High/Low
This mode calculates the upper and lower barriers from the recent price range.
Best for:
• Breakout trading
• Range expansion setups
• Support and resistance breaks
• Consolidation breakouts
Manual
Manual mode allows the trader to define the upper and lower barriers.
Best for:
• Key technical levels
• Previous day high/low
• Weekly high/low
• Round numbers
• Event levels
• Liquidity zones
Expected Move
Expected Move mode creates volatility-adjusted barriers.
Best for:
• Volatility-based breakout analysis
• Event-risk planning
• Comparing price movement to expected range
• Adaptive barrier levels
CONFIRMATION MODE GUIDE
━━━━━━━━━━━━━━━━━━━━━━
Touch Barrier
This mode triggers as soon as price touches the barrier.
It is the most sensitive setting.
Best for early warning, but it will produce more false signals.
Close Beyond Barrier
This mode requires the candle to close beyond the barrier.
It is more reliable than simple touch logic.
This is a balanced setting.
Close + Buffer
This mode requires price to close beyond the barrier by an additional buffer.
It is the strictest setting.
Best for reducing false breakouts.
RETEST LOGIC GUIDE
━━━━━━━━━━━━━━━━━━━━━━
A retest occurs when price breaks the barrier and then returns to test it.
For bullish breakouts, the upper barrier should ideally act as support.
For bearish breakouts, the lower barrier should ideally act as resistance.
Retest confirmation can help traders avoid chasing the initial breakout candle.
However, not all strong breakouts retest.
A very strong breakout may continue without giving a clean retest.
FAILURE LOGIC GUIDE
━━━━━━━━━━━━━━━━━━━━━━
A breakout failure occurs when price breaks the barrier but then returns back inside the active barrier.
This can be important because failed breakouts often indicate trapped positioning.
A bullish breakout failure can suggest:
• Bull trap
• Liquidity sweep above resistance
• Failed upside continuation
• Potential reversal risk
A bearish breakout failure can suggest:
• Bear trap
• Liquidity sweep below support
• Failed downside continuation
• Potential reversal risk
Failure signals should still be confirmed with price structure and risk management.
HOW TO COMBINE WITH OTHER INDICATORS
━━━━━━━━━━━━━━━━━━━━━━
This indicator works best as part of a broader volatility and market-structure framework.
Useful combinations:
• Expected Move Bands
• Realized Volatility Regime Indicator
• Implied Volatility Proxy
• Delta-Hedging Pressure Proxy
• Dynamic Stop-Loss Using Expected Move
• Risk-Neutral Probability Cone
• VWAP
• Moving averages
• Support and resistance
• Liquidity zones
• Market structure breaks
• Macro and event calendars
Suggested framework:
Expected Move Bands show near-term volatility-adjusted levels.
Realized Volatility Regime shows whether volatility is low, normal, high, or extreme.
IV Proxy shows whether broader uncertainty is rising or cooling.
Delta-Hedging Pressure Proxy shows whether directional pressure is positive or negative.
Dynamic Stop-Loss converts volatility into risk levels.
Risk-Neutral Probability Cone maps forward probability ranges.
Barrier Option-Style Breakout Indicator tracks whether price has activated, confirmed, retested, or failed a breakout barrier.
Together, these tools help answer:
• Where are the breakout levels?
• Has price activated the barrier?
• Is the breakout high quality or weak?
• Has the breakout retested and held?
• Has the breakout failed?
• How far can price reasonably move?
• Where should stops and targets be placed?
• Should position size be reduced?
TRADING EXAMPLES
━━━━━━━━━━━━━━━━━━━━━━
Example 1: Bullish Knock-In
Price breaks above the upper barrier.
The dashboard shows:
• Market State: Bullish Knock-In
• Quality Filter: Pass
• Volatility Percentile: above threshold
• Volume Ratio: above threshold
This suggests that the upside breakout has been activated and supported by quality conditions.
A trader may look for continuation, but should still manage risk carefully.
Example 2: Bullish Retest Confirmed
Price breaks above the upper barrier, then returns to retest the barrier and holds above it.
The dashboard shows:
• Market State: Bullish Retest Confirmed
This is often a stronger continuation setup than the initial breakout candle.
A trader may use the active barrier as a key invalidation reference.
Example 3: Weak Upper Breach
Price moves above the upper barrier, but the quality filter fails.
The dashboard shows:
• Market State: Weak Upper Breach
• Quality Filter: Fail
This suggests caution.
The breakout may not have enough volatility or volume support.
Example 4: Bullish Barrier Failed
Price breaks above the upper barrier but then closes back below the active barrier.
The dashboard shows:
• Market State: Bullish Barrier Failed
This may indicate a bull trap, failed breakout, or liquidity sweep.
A trader should avoid assuming continuation unless price reclaims the barrier.
Example 5: Bearish Retest Confirmed
Price breaks below the lower barrier, then retests the barrier from below and fails to reclaim it.
The dashboard shows:
• Market State: Bearish Retest Confirmed
This suggests downside breakout structure remains valid.
A trader may use the active barrier as a resistance and invalidation reference.
RISK MANAGEMENT NOTES
━━━━━━━━━━━━━━━━━━━━━━
Breakout strategies can suffer from false signals.
This indicator helps reduce that risk by separating:
• Weak breaches
• Confirmed knock-ins
• Retest confirmations
• Failed breakouts
Practical risk rules:
• Do not chase every knock-in candle
• Treat weak breaches with caution
• Wait for retest confirmation if chasing risk is high
• Use failed breakout signals as risk warnings
• Use the active barrier as an invalidation reference
• Reduce size in high-volatility conditions
• Do not rely on volume filters when the asset has poor volume data
• Combine with expected move and dynamic stop tools
A breakout is not automatically valid because price crossed a line.
The path after the breakout matters.
WHAT THIS INDICATOR IS BEST FOR
━━━━━━━━━━━━━━━━━━━━━━
This indicator is best used for:
• Breakout quality assessment
• Range breakout tracking
• Barrier activation logic
• Retest confirmation
• Failed breakout detection
• Liquidity sweep awareness
• Event-level breakout monitoring
• Support and resistance breakout analysis
• Volatility-adjusted breakout levels
• Trade planning and risk management
It is useful for traders who want more structure than a basic support/resistance breakout signal.
WHAT THIS INDICATOR IS NOT
━━━━━━━━━━━━━━━━━━━━━━
This indicator is not:
• A standalone trading strategy
• A guaranteed breakout system
• A buy or sell signal generator
• A true barrier option pricing model
• A full first-passage probability model
• A replacement for risk management
• A replacement for market structure
• A complete trading system
The indicator identifies breakout states.
It does not guarantee continuation.
IMPORTANT LIMITATIONS
━━━━━━━━━━━━━━━━━━━━━━
The indicator uses price, volatility, range, and volume data.
It does not include:
• Order flow
• Market depth
• Dealer positioning
• Options open interest
• Real barrier option pricing
• News sentiment
• Fundamental data
• Liquidity conditions
The probability estimate is simplified.
It is not a full barrier option first-passage model.
Volume quality may differ across markets.
For example:
• FX broker volume is usually tick volume
• Crypto volume depends on exchange feed
• Equities and futures volume are generally more reliable
• Indices may use synthetic or broker-dependent volume
Breakouts can fail even when quality filters pass.
The indicator should be used as a decision-support tool, not as a standalone system.
FINAL NOTES
━━━━━━━━━━━━━━━━━━━━━━
The Barrier Option-Style Breakout Indicator helps traders think about breakouts as path-dependent events.
Instead of asking only whether price crossed a level, the tool helps answer:
• Did price activate the barrier?
• Was the breakout strong or weak?
• Did volatility and volume support the move?
• Did price retest the barrier?
• Did the barrier hold?
• Did the breakout fail?
• Is the active barrier now the key invalidation level?
The indicator is designed to improve breakout discipline, reduce emotional chasing, and provide a structured way to monitor breakout behaviour.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.