OPEN-SOURCE SCRIPT
Updated BB Breakout-Momentum + Reversion Strategies

# BB Breakout-Momentum + Reversion Strategies
## Overview
This indicator combines two complementary Bollinger Band trading strategies that automatically adapt to market conditions. Strategy 1 capitalizes on trending markets with breakout-pullback-momentum setups, while Strategy 2 exploits mean reversion in ranging markets. Advanced filtering using ADX and BB Width ensures each strategy only fires in its optimal market environment.
---
## Strategy 1: Breakout → Pullback → Renewed Momentum (Long B / Short B)
### Best Market Conditions
- **Trending Markets**: ADX ≥ 25
- **High Volatility**: BB Width ≥ 1.0× average
- Directional price action with sustained momentum
### Entry Logic
**Long B (Bullish Breakout):**
1. **Initial Breakout**: Price breaks above upper Bollinger Band with strong momentum
2. **Controlled Pullback**: Price pulls back 1-12 bars but holds above lower band (stays in trend)
3. **Defended Zone**: Pullback creates a support zone based on swing lows (validated by multiple touches)
4. **Renewed Momentum**: Price reclaims with green candle, volume confirmation, bullish MACD
5. **Position Check**: Entry must have cushion below upper band and room to reach targets
**Short B (Bearish Breakdown):**
- Mirror logic for downtrends: breakdown below lower band, pullback stays below upper band, renewed selling pressure
### Risk Management
- **Stop Loss**: Lower of (zone floor/previous low) OR (1.5 × ATR from entry)
- **Targets**:
- T1: Entry + 0.85R (0.85 × 1.5 ATR)
- T2: Entry + 1.40R (1.40 × 1.5 ATR)
- T3: Entry + 2.50R (2.50 × 1.5 ATR)
- T4: Entry + 4.50R (4.50 × 1.5 ATR)
- Risk is calculated using ATR (ATRX = 1.5 ATR), stop uses tighter of structural level (ATRL) or ATRX
---
## Strategy 2: Bollinger Band Mean Reversion (Long R / Short R)
### Best Market Conditions
- **Ranging Markets**: ADX ≤ 20
- **Low Volatility**: BB Width ≤ 0.8× average
- Price oscillating around the mean without sustained trend
### Entry Logic
**Long R (Long Reversion):**
1. **Overextension**: Price breaks below lower Bollinger Band (2 consecutive closes)
2. **Snap Back**: Price crosses back above lower band (re-enters the range)
3. **Entry Window**: Within 2 candles of re-entry, look for:
- **Green candle** (close > open) confirming bullish strength
- Close above previous candle (close > close[1])
4. **Trigger**: First qualifying candle within 2-bar window executes the trade
**Short R (Short Reversion):**
1. **Overextension**: Price breaks above upper Bollinger Band (2 consecutive closes)
2. **Snap Back**: Price crosses back below upper band (re-enters the range)
3. **Entry Window**: Within 2 candles of re-entry, look for:
- **Red candle** (close < open) confirming bearish pressure
- Close below previous candle (close < close[1])
4. **Trigger**: First qualifying candle within 2-bar window executes the trade
### Risk Management
- **Stop Loss**: Lower of (previous high/low) OR (1.5 × ATR from entry)
- **Targets**: Same as Strategy 1 (0.85R, 1.4R, 2.5R, 4.5R based on 1.5 ATR)
- Betting on return to Bollinger Band basis (mean)
---
## Advanced Filtering System
### ADX Filter (Average Directional Index)
- **Purpose**: Measures trend strength vs choppy/ranging conditions
- **Trending**: ADX ≥ 25 → Enables Strategy 1 (Breakout)
- **Ranging**: ADX ≤ 20 → Enables Strategy 2 (Reversion)
- **Neutral**: ADX 20-25 → No signals (indecisive market)
### BB Width Filter
- **Purpose**: Confirms volatility expansion/contraction
- **Wide Bands**: Current width ≥ 1.0× 50-bar average → Trending environment
- **Narrow Bands**: Current width ≤ 0.8× 50-bar average → Ranging environment
- **Logic**: Both ADX and BB Width must agree on market state before signaling
### Combined Logic
- **Strategy 1 fires**: When BOTH ADX shows trending AND bands are wide
- **Strategy 2 fires**: When BOTH ADX shows ranging AND bands are narrow
- **Visual Display**: Table at bottom-right shows ADX value, BB Width ratio, and current market state
---
## Visual Elements
### Bollinger Bands
- **Gray line**: 20-period SMA (basis/mean)
- **Green line**: Upper band (basis + 2 standard deviations)
- **Red line**: Lower band (basis - 2 standard deviations)
### Strategy 1 Markers
- **Long B**: Green triangle below bar with "Long B" text
- **Short B**: Orange triangle above bar with "Short B" text
- **Defended Zones**: Green/red boxes showing pullback support/resistance areas
- **Targets**: Green/orange crosses showing T1-T4 and stop loss levels
### Strategy 2 Markers
- **Long R**: Blue label below bar with "Long R" text
- **Short R**: Purple label above bar with "Short R" text
- **Trade Levels**: Horizontal lines extending 50 bars forward
- Blue solid = Entry price
- Red dashed = Stop loss
- Green/Orange dotted = Targets (T1-T4)
### Market State Table
- **ADX**: Current value with color coding (green=trending, orange=ranging, gray=neutral)
- **BB Width**: Ratio vs 50-bar average (e.g., "1.15x" = 15% wider than average)
- **State**: TREND / RANGE / NEUTRAL classification
---
## Settings & Customization
### Bollinger Bands
- **BB Length**: 20 (default) - period for moving average
- **BB Std Dev**: 2.0 (default) - standard deviation multiplier
### ATR & Risk
- **ATR Length**: 14 (default) - period for Average True Range calculation
- All stop losses and targets are derived from 1.5 × ATR
### Trend/Range Filters
- **ADX Length**: 14 (default)
- **ADX Trending Threshold**: 25 (higher = stronger trend required)
- **ADX Ranging Threshold**: 20 (lower = tighter ranging condition)
- **BB Width Average Length**: 50 (period for comparing current width)
- **BB Width Trend Multiplier**: 1.0 (width must be ≥ this × average)
- **BB Width Range Multiplier**: 0.8 (width must be ≤ this × average)
- **Use ADX Filter**: Toggle on/off
- **Use BB Width Filter**: Toggle on/off
### Strategy 1 (Breakout-Momentum)
- **Breakout Lookback**: 15 bars (how far back to search for initial breakout)
- **Min Pullback Bars**: 1 (minimum consolidation period)
- **Max Pullback Bars**: 12 (maximum consolidation period)
- **Show Defended Zone**: Display support/resistance boxes
- **Show Signals**: Display Long B / Short B markers
- **Show Targets**: Display stop loss and target levels
### Strategy 2 (Reversion)
- **Show Signals**: Display Long R / Short R markers
- **Show Trade Levels**: Display entry, stop, and target lines
---
## How to Use This Indicator
### Step 1: Identify Market State
- Check the table in bottom-right corner
- **TREND**: Look for Strategy 1 signals (Long B / Short B)
- **RANGE**: Look for Strategy 2 signals (Long R / Short R)
- **NEUTRAL**: Wait for clearer conditions
### Step 2: Wait for Signal
- Signals only fire when ALL conditions are met (structural + momentum + filters + room-to-target)
- Signals are relatively rare but high-probability
### Step 3: Execute Trade
- **Entry**: Close of signal candle
- **Stop Loss**: Shown as red cross (Strategy 1) or red dashed line (Strategy 2)
- **Targets**: Scale out at T1, T2, T3, T4 or hold for maximum R:R
### Step 4: Management
- Consider moving stop to breakeven after T1
- Trail stop using swing lows/highs in Strategy 1
- Exit full position at T2-T3 in Strategy 2 (mean reversion has limited upside)
---
## Key Principles
### Why This Works
1. **Market Adaptation**: Uses right strategy for right conditions (trend vs range)
2. **Confluence**: Multiple confirmations required (structure + momentum + volatility + room)
3. **Risk-Defined**: Every trade has pre-calculated stop and targets based on ATR
4. **Probability**: Filters reduce noise and increase win rate by waiting for ideal setups
### Common Pitfalls to Avoid
- ❌ Taking signals in NEUTRAL market state (indicators disagree)
- ❌ Overriding the stop loss (it's calculated for a reason)
- ❌ Expecting signals on every swing (quality over quantity)
- ❌ Using Strategy 1 in ranging markets or Strategy 2 in trending markets
- ❌ Ignoring the room-to-target check (signal won't fire if targets are blocked)
### Complementary Analysis
This indicator works best when combined with:
- Higher timeframe trend analysis
- Key support/resistance levels
- Volume analysis
- Market structure (swing highs/lows)
- Risk management rules (position sizing, max daily loss, etc.)
---
## Technical Details
### Indicators Used
- **Bollinger Bands**: 20-period SMA ± 2 standard deviations
- **ATR**: 14-period Average True Range for volatility measurement
- **ADX**: 14-period Average Directional Index for trend strength
- **EMA**: 10 and 20-period exponential moving averages (Strategy 1 filter)
- **MACD**: 12/26/9 settings (Strategy 1 momentum confirmation)
- **Volume**: Compared to 15-bar average (Strategy 1 confirmation)
### Calculation Methodology
- **ATRL** (Structural Risk): Previous swing high/low or defended zone boundary
- **ATRX** (ATR Risk): 1.5 × 14-period ATR from entry price
- **Stop Loss**: Minimum of ATRL and ATRX (tightest protection)
- **Targets**: Always calculated from ATRX (consistent R-multiples)
- **BB Width Ratio**: Current BB width ÷ 50-period SMA of BB width
---
## Performance Notes
### Strengths
- Adapts to changing market conditions automatically
- Clear, objective entry and exit criteria
- Pre-defined risk on every trade
- Filters reduce false signals significantly
- Works across multiple timeframes and instruments
### Limitations
- Signals are infrequent (by design - quality over quantity)
- Requires patience to wait for all conditions to align
- May miss explosive moves if pullback doesn't form properly (Strategy 1)
- Ranging markets can transition to trending (Strategy 2 risk)
- Filters may delay entry in fast-moving markets
### Best Timeframes
- **Strategy 1**: 1H, 4H, Daily (needs time for proper pullback structure)
- **Strategy 2**: 15M, 30M, 1H (mean reversion works best intraday)
- Both strategies can work on any timeframe if market conditions are right
### Best Instruments
- **Liquid markets**: Major stocks, indices, forex pairs, liquid crypto
- **Sufficient volatility**: ATR should be meaningful relative to price
- **Clear trend/range cycles**: Markets that respect technical levels
---
## IMPORTANT DISCLAIMER
### Risk Warning
**TRADING INVOLVES SUBSTANTIAL RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS.**
This indicator is provided for **educational and informational purposes only**. It does not constitute financial advice, investment advice, trading advice, or any other sort of advice. You should not treat any of the indicator's content as such.
### No Guarantee of Profit
Past performance is not indicative of future results. No trading strategy, including this indicator, can guarantee profits or protect against losses. The market is inherently unpredictable and all trading involves risk.
### User Responsibility
- **Do Your Own Research**: Always conduct your own analysis before making trading decisions
- **Test First**: Backtest and paper trade this strategy before risking real capital
- **Risk Management**: Never risk more than you can afford to lose
- **Position Sizing**: Use appropriate position sizes relative to your account
- **Stop Losses**: Always use stop losses and respect them
- **Market Conditions**: Understand that market conditions change and past behavior may not repeat
### No Liability
The creator of this indicator accepts no liability for any financial losses incurred through the use of this tool. All trading decisions are made at your own risk. You are solely responsible for evaluating the merits and risks associated with the use of any trading systems, signals, or content provided.
### Not Financial Advice
This indicator does not take into account your personal financial situation, investment objectives, risk tolerance, or specific needs. You should consult with a licensed financial advisor before making any investment decisions.
### Technical Limitations
- Indicators can repaint or lag in real-time
- Past signals may look different than real-time signals
- Code bugs or errors may exist despite testing
- TradingView platform limitations may affect functionality
### Market Risks
- Markets can gap, causing stops to be executed at worse prices
- Slippage and commissions can significantly impact results
- High volatility can cause unexpected losses
- Counterparty risk exists in all leveraged products
---
## Version History
- **v1.0**: Initial release combining breakout-momentum and mean reversion strategies
- Includes ADX and BB Width filtering
- ATRL/ATRX risk calculation system
- 2-candle entry window for reversion trades
---
## Credits & License
This indicator combines concepts from classical technical analysis including Bollinger Bands (John Bollinger), ATR (Welles Wilder), and ADX (Welles Wilder). The specific implementation and combination of filters is original work.
**Use at your own risk. Trade responsibly.**
---
*For questions, suggestions, or to report bugs, please comment below or contact the author.*
**Remember: The best indicator is the one between your ears. Use this tool as part of a comprehensive trading plan, not as a standalone solution.**
## Overview
This indicator combines two complementary Bollinger Band trading strategies that automatically adapt to market conditions. Strategy 1 capitalizes on trending markets with breakout-pullback-momentum setups, while Strategy 2 exploits mean reversion in ranging markets. Advanced filtering using ADX and BB Width ensures each strategy only fires in its optimal market environment.
---
## Strategy 1: Breakout → Pullback → Renewed Momentum (Long B / Short B)
### Best Market Conditions
- **Trending Markets**: ADX ≥ 25
- **High Volatility**: BB Width ≥ 1.0× average
- Directional price action with sustained momentum
### Entry Logic
**Long B (Bullish Breakout):**
1. **Initial Breakout**: Price breaks above upper Bollinger Band with strong momentum
2. **Controlled Pullback**: Price pulls back 1-12 bars but holds above lower band (stays in trend)
3. **Defended Zone**: Pullback creates a support zone based on swing lows (validated by multiple touches)
4. **Renewed Momentum**: Price reclaims with green candle, volume confirmation, bullish MACD
5. **Position Check**: Entry must have cushion below upper band and room to reach targets
**Short B (Bearish Breakdown):**
- Mirror logic for downtrends: breakdown below lower band, pullback stays below upper band, renewed selling pressure
### Risk Management
- **Stop Loss**: Lower of (zone floor/previous low) OR (1.5 × ATR from entry)
- **Targets**:
- T1: Entry + 0.85R (0.85 × 1.5 ATR)
- T2: Entry + 1.40R (1.40 × 1.5 ATR)
- T3: Entry + 2.50R (2.50 × 1.5 ATR)
- T4: Entry + 4.50R (4.50 × 1.5 ATR)
- Risk is calculated using ATR (ATRX = 1.5 ATR), stop uses tighter of structural level (ATRL) or ATRX
---
## Strategy 2: Bollinger Band Mean Reversion (Long R / Short R)
### Best Market Conditions
- **Ranging Markets**: ADX ≤ 20
- **Low Volatility**: BB Width ≤ 0.8× average
- Price oscillating around the mean without sustained trend
### Entry Logic
**Long R (Long Reversion):**
1. **Overextension**: Price breaks below lower Bollinger Band (2 consecutive closes)
2. **Snap Back**: Price crosses back above lower band (re-enters the range)
3. **Entry Window**: Within 2 candles of re-entry, look for:
- **Green candle** (close > open) confirming bullish strength
- Close above previous candle (close > close[1])
4. **Trigger**: First qualifying candle within 2-bar window executes the trade
**Short R (Short Reversion):**
1. **Overextension**: Price breaks above upper Bollinger Band (2 consecutive closes)
2. **Snap Back**: Price crosses back below upper band (re-enters the range)
3. **Entry Window**: Within 2 candles of re-entry, look for:
- **Red candle** (close < open) confirming bearish pressure
- Close below previous candle (close < close[1])
4. **Trigger**: First qualifying candle within 2-bar window executes the trade
### Risk Management
- **Stop Loss**: Lower of (previous high/low) OR (1.5 × ATR from entry)
- **Targets**: Same as Strategy 1 (0.85R, 1.4R, 2.5R, 4.5R based on 1.5 ATR)
- Betting on return to Bollinger Band basis (mean)
---
## Advanced Filtering System
### ADX Filter (Average Directional Index)
- **Purpose**: Measures trend strength vs choppy/ranging conditions
- **Trending**: ADX ≥ 25 → Enables Strategy 1 (Breakout)
- **Ranging**: ADX ≤ 20 → Enables Strategy 2 (Reversion)
- **Neutral**: ADX 20-25 → No signals (indecisive market)
### BB Width Filter
- **Purpose**: Confirms volatility expansion/contraction
- **Wide Bands**: Current width ≥ 1.0× 50-bar average → Trending environment
- **Narrow Bands**: Current width ≤ 0.8× 50-bar average → Ranging environment
- **Logic**: Both ADX and BB Width must agree on market state before signaling
### Combined Logic
- **Strategy 1 fires**: When BOTH ADX shows trending AND bands are wide
- **Strategy 2 fires**: When BOTH ADX shows ranging AND bands are narrow
- **Visual Display**: Table at bottom-right shows ADX value, BB Width ratio, and current market state
---
## Visual Elements
### Bollinger Bands
- **Gray line**: 20-period SMA (basis/mean)
- **Green line**: Upper band (basis + 2 standard deviations)
- **Red line**: Lower band (basis - 2 standard deviations)
### Strategy 1 Markers
- **Long B**: Green triangle below bar with "Long B" text
- **Short B**: Orange triangle above bar with "Short B" text
- **Defended Zones**: Green/red boxes showing pullback support/resistance areas
- **Targets**: Green/orange crosses showing T1-T4 and stop loss levels
### Strategy 2 Markers
- **Long R**: Blue label below bar with "Long R" text
- **Short R**: Purple label above bar with "Short R" text
- **Trade Levels**: Horizontal lines extending 50 bars forward
- Blue solid = Entry price
- Red dashed = Stop loss
- Green/Orange dotted = Targets (T1-T4)
### Market State Table
- **ADX**: Current value with color coding (green=trending, orange=ranging, gray=neutral)
- **BB Width**: Ratio vs 50-bar average (e.g., "1.15x" = 15% wider than average)
- **State**: TREND / RANGE / NEUTRAL classification
---
## Settings & Customization
### Bollinger Bands
- **BB Length**: 20 (default) - period for moving average
- **BB Std Dev**: 2.0 (default) - standard deviation multiplier
### ATR & Risk
- **ATR Length**: 14 (default) - period for Average True Range calculation
- All stop losses and targets are derived from 1.5 × ATR
### Trend/Range Filters
- **ADX Length**: 14 (default)
- **ADX Trending Threshold**: 25 (higher = stronger trend required)
- **ADX Ranging Threshold**: 20 (lower = tighter ranging condition)
- **BB Width Average Length**: 50 (period for comparing current width)
- **BB Width Trend Multiplier**: 1.0 (width must be ≥ this × average)
- **BB Width Range Multiplier**: 0.8 (width must be ≤ this × average)
- **Use ADX Filter**: Toggle on/off
- **Use BB Width Filter**: Toggle on/off
### Strategy 1 (Breakout-Momentum)
- **Breakout Lookback**: 15 bars (how far back to search for initial breakout)
- **Min Pullback Bars**: 1 (minimum consolidation period)
- **Max Pullback Bars**: 12 (maximum consolidation period)
- **Show Defended Zone**: Display support/resistance boxes
- **Show Signals**: Display Long B / Short B markers
- **Show Targets**: Display stop loss and target levels
### Strategy 2 (Reversion)
- **Show Signals**: Display Long R / Short R markers
- **Show Trade Levels**: Display entry, stop, and target lines
---
## How to Use This Indicator
### Step 1: Identify Market State
- Check the table in bottom-right corner
- **TREND**: Look for Strategy 1 signals (Long B / Short B)
- **RANGE**: Look for Strategy 2 signals (Long R / Short R)
- **NEUTRAL**: Wait for clearer conditions
### Step 2: Wait for Signal
- Signals only fire when ALL conditions are met (structural + momentum + filters + room-to-target)
- Signals are relatively rare but high-probability
### Step 3: Execute Trade
- **Entry**: Close of signal candle
- **Stop Loss**: Shown as red cross (Strategy 1) or red dashed line (Strategy 2)
- **Targets**: Scale out at T1, T2, T3, T4 or hold for maximum R:R
### Step 4: Management
- Consider moving stop to breakeven after T1
- Trail stop using swing lows/highs in Strategy 1
- Exit full position at T2-T3 in Strategy 2 (mean reversion has limited upside)
---
## Key Principles
### Why This Works
1. **Market Adaptation**: Uses right strategy for right conditions (trend vs range)
2. **Confluence**: Multiple confirmations required (structure + momentum + volatility + room)
3. **Risk-Defined**: Every trade has pre-calculated stop and targets based on ATR
4. **Probability**: Filters reduce noise and increase win rate by waiting for ideal setups
### Common Pitfalls to Avoid
- ❌ Taking signals in NEUTRAL market state (indicators disagree)
- ❌ Overriding the stop loss (it's calculated for a reason)
- ❌ Expecting signals on every swing (quality over quantity)
- ❌ Using Strategy 1 in ranging markets or Strategy 2 in trending markets
- ❌ Ignoring the room-to-target check (signal won't fire if targets are blocked)
### Complementary Analysis
This indicator works best when combined with:
- Higher timeframe trend analysis
- Key support/resistance levels
- Volume analysis
- Market structure (swing highs/lows)
- Risk management rules (position sizing, max daily loss, etc.)
---
## Technical Details
### Indicators Used
- **Bollinger Bands**: 20-period SMA ± 2 standard deviations
- **ATR**: 14-period Average True Range for volatility measurement
- **ADX**: 14-period Average Directional Index for trend strength
- **EMA**: 10 and 20-period exponential moving averages (Strategy 1 filter)
- **MACD**: 12/26/9 settings (Strategy 1 momentum confirmation)
- **Volume**: Compared to 15-bar average (Strategy 1 confirmation)
### Calculation Methodology
- **ATRL** (Structural Risk): Previous swing high/low or defended zone boundary
- **ATRX** (ATR Risk): 1.5 × 14-period ATR from entry price
- **Stop Loss**: Minimum of ATRL and ATRX (tightest protection)
- **Targets**: Always calculated from ATRX (consistent R-multiples)
- **BB Width Ratio**: Current BB width ÷ 50-period SMA of BB width
---
## Performance Notes
### Strengths
- Adapts to changing market conditions automatically
- Clear, objective entry and exit criteria
- Pre-defined risk on every trade
- Filters reduce false signals significantly
- Works across multiple timeframes and instruments
### Limitations
- Signals are infrequent (by design - quality over quantity)
- Requires patience to wait for all conditions to align
- May miss explosive moves if pullback doesn't form properly (Strategy 1)
- Ranging markets can transition to trending (Strategy 2 risk)
- Filters may delay entry in fast-moving markets
### Best Timeframes
- **Strategy 1**: 1H, 4H, Daily (needs time for proper pullback structure)
- **Strategy 2**: 15M, 30M, 1H (mean reversion works best intraday)
- Both strategies can work on any timeframe if market conditions are right
### Best Instruments
- **Liquid markets**: Major stocks, indices, forex pairs, liquid crypto
- **Sufficient volatility**: ATR should be meaningful relative to price
- **Clear trend/range cycles**: Markets that respect technical levels
---
## IMPORTANT DISCLAIMER
### Risk Warning
**TRADING INVOLVES SUBSTANTIAL RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS.**
This indicator is provided for **educational and informational purposes only**. It does not constitute financial advice, investment advice, trading advice, or any other sort of advice. You should not treat any of the indicator's content as such.
### No Guarantee of Profit
Past performance is not indicative of future results. No trading strategy, including this indicator, can guarantee profits or protect against losses. The market is inherently unpredictable and all trading involves risk.
### User Responsibility
- **Do Your Own Research**: Always conduct your own analysis before making trading decisions
- **Test First**: Backtest and paper trade this strategy before risking real capital
- **Risk Management**: Never risk more than you can afford to lose
- **Position Sizing**: Use appropriate position sizes relative to your account
- **Stop Losses**: Always use stop losses and respect them
- **Market Conditions**: Understand that market conditions change and past behavior may not repeat
### No Liability
The creator of this indicator accepts no liability for any financial losses incurred through the use of this tool. All trading decisions are made at your own risk. You are solely responsible for evaluating the merits and risks associated with the use of any trading systems, signals, or content provided.
### Not Financial Advice
This indicator does not take into account your personal financial situation, investment objectives, risk tolerance, or specific needs. You should consult with a licensed financial advisor before making any investment decisions.
### Technical Limitations
- Indicators can repaint or lag in real-time
- Past signals may look different than real-time signals
- Code bugs or errors may exist despite testing
- TradingView platform limitations may affect functionality
### Market Risks
- Markets can gap, causing stops to be executed at worse prices
- Slippage and commissions can significantly impact results
- High volatility can cause unexpected losses
- Counterparty risk exists in all leveraged products
---
## Version History
- **v1.0**: Initial release combining breakout-momentum and mean reversion strategies
- Includes ADX and BB Width filtering
- ATRL/ATRX risk calculation system
- 2-candle entry window for reversion trades
---
## Credits & License
This indicator combines concepts from classical technical analysis including Bollinger Bands (John Bollinger), ATR (Welles Wilder), and ADX (Welles Wilder). The specific implementation and combination of filters is original work.
**Use at your own risk. Trade responsibly.**
---
*For questions, suggestions, or to report bugs, please comment below or contact the author.*
**Remember: The best indicator is the one between your ears. Use this tool as part of a comprehensive trading plan, not as a standalone solution.**
Release Notes
Update Summary: Strategy 2 Now Trades in Neutral MarketsWhat Changed:
Strategy 2 (Mean Reversion - Long R/Short R) can now fire signals in NEUTRAL market conditions, not just RANGING.
Previous Behavior:
RANGE (ADX ≤ 20) → Strategy 2 ✅
NEUTRAL (ADX 20-25) → No signals ❌
TREND (ADX ≥ 25) → Strategy 1 ✅
New Behavior:
RANGE (ADX ≤ 20) → Strategy 2 ✅
NEUTRAL (ADX 20-25) → Strategy 2 ✅ [NEW]
TREND (ADX ≥ 25) → Strategy 1 ✅
Why:
When ADX is between 20-25 (or indicators disagree), the market isn't trending strongly enough for breakout trades, but mean reversion can still work effectively when price reaches Bollinger Band extremes.
Impact:
More Strategy 2 signals - captures reversion opportunities in uncertain markets
Strategy 1 remains strict - only fires in clear trending conditions
Better opportunity capture - neutral markets often provide good fade-the-extreme setups
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.