PROTECTED SOURCE SCRIPT
Break-Retest-Scale [v1]

Break of Structure (BOS) retest strategy with Thirds exit scaling (33/33/34%). Enters after price breaks and retests a swing level, then scales out at escalating R-multiples while moving to breakeven after TP1.
OVERVIEW
1 — BOS Detection: Price breaks above a swing high (bullish) or below a swing low (bearish)
2 — Retest Window: Strategy waits for price to return and test the broken level
3 — Entry: When price touches the retest zone and closes back on the right side
4 — Exit: Position is split into thirds with escalating profit targets
EXIT STRUCTURE (THIRDS PATTERN)
• TP1: 33% at 1R — Stop stays at initial SL
• TP2: 33% at 2R — Stop moves to breakeven
• TP3: 34% at 3R — Stop at breakeven
After TP1 is hit, the stop automatically moves to breakeven (with a small ATR buffer to avoid stop-hunting wicks).
KEY FEATURES
• Split Pivot Detection: Separate left/right bars for swing significance vs detection speed
• Reclaim Modes: Three entry styles — Close, Wick Rejection, Full Bar (strictest)
• Volume Filter: Optional above-average volume requirement on BOS
• Frozen Brackets: SL and TP levels locked at entry — no ATR drift
• Smart BE Detection: Uses position reduction to detect TP1 hit
• Structure-Based SL: Stop placed below/above last swing with ATR floor
• BOS Max Age: Swing levels expire after N bars to prevent stale breakouts
VALIDATED RESULTS
• MYM 5min (Aug-Feb 2026): +56.6% | PF 2.10 | 52% win | 11.9% DD
• MES 5min (Dec-Feb 2026): +51.9% | PF 6.57 | 57.5% win | 7.3% DD
• M2K 5min (Dec-Feb 2026): +42.6% | PF 4.01 | 51.4% win | 7.2% DD
RECOMMENDED SETTINGS
MES 5min (Best Performance)
• Structure: Left=20, Right=2, Tol=0.2, Window=9, Age=20
• Reclaim Mode: Full Bar, Volume Filter: ON
• Risk: SL ATR Min=1.25, SL Buffer=0.2
• TP1/TP2/TP3: 0.7R / 1.5R / 4R
M2K 5min (Balanced)
• Structure: Left=16, Right=3, Tol=0.1, Window=11, Age=30
• Reclaim Mode: Close, Volume Filter: ON
• Risk: SL ATR Min=1.5, SL Buffer=0.1
• TP1/TP2/TP3: 1R / 3R / 3.5R
MYM 5min (Long-Bias)
• Structure: Left=16, Right=4, Tol=0.4, Window=15, Age=35
• Reclaim Mode: Close, Volume Filter: ON
• Risk: SL ATR Min=1.0, SL Buffer=0.2
• TP1/TP2/TP3: 1R / 1.5R / 2R
POSITION SIZING
With `strategy.fixed`, position size meaning varies by instrument:
• Futures: Contracts (3 = 3 contracts)
• FX: Units (30000 = 0.3 lots)
• Crypto: Coins (0.1 = 0.1 BTC)
• Stocks: Shares (100 = 100 shares)
NOTES
• Position size must be divisible by 3 for Thirds exit to work correctly
• For FX: use units (30000), not lots (0.3)
• Sunday filter enabled by default to avoid FX gaps
• The "look-ahead bias" warning is a false positive — uses `lookahead=barmerge.lookahead_off`
• Commission/slippage set for futures — adjust in Properties for your instrument
• Margin set to 5% ($500/contract on $10K) — adjust as needed
Not financial advice. Always backtest on your specific instrument and timeframe.
OVERVIEW
1 — BOS Detection: Price breaks above a swing high (bullish) or below a swing low (bearish)
2 — Retest Window: Strategy waits for price to return and test the broken level
3 — Entry: When price touches the retest zone and closes back on the right side
4 — Exit: Position is split into thirds with escalating profit targets
EXIT STRUCTURE (THIRDS PATTERN)
• TP1: 33% at 1R — Stop stays at initial SL
• TP2: 33% at 2R — Stop moves to breakeven
• TP3: 34% at 3R — Stop at breakeven
After TP1 is hit, the stop automatically moves to breakeven (with a small ATR buffer to avoid stop-hunting wicks).
KEY FEATURES
• Split Pivot Detection: Separate left/right bars for swing significance vs detection speed
• Reclaim Modes: Three entry styles — Close, Wick Rejection, Full Bar (strictest)
• Volume Filter: Optional above-average volume requirement on BOS
• Frozen Brackets: SL and TP levels locked at entry — no ATR drift
• Smart BE Detection: Uses position reduction to detect TP1 hit
• Structure-Based SL: Stop placed below/above last swing with ATR floor
• BOS Max Age: Swing levels expire after N bars to prevent stale breakouts
VALIDATED RESULTS
• MYM 5min (Aug-Feb 2026): +56.6% | PF 2.10 | 52% win | 11.9% DD
• MES 5min (Dec-Feb 2026): +51.9% | PF 6.57 | 57.5% win | 7.3% DD
• M2K 5min (Dec-Feb 2026): +42.6% | PF 4.01 | 51.4% win | 7.2% DD
RECOMMENDED SETTINGS
MES 5min (Best Performance)
• Structure: Left=20, Right=2, Tol=0.2, Window=9, Age=20
• Reclaim Mode: Full Bar, Volume Filter: ON
• Risk: SL ATR Min=1.25, SL Buffer=0.2
• TP1/TP2/TP3: 0.7R / 1.5R / 4R
M2K 5min (Balanced)
• Structure: Left=16, Right=3, Tol=0.1, Window=11, Age=30
• Reclaim Mode: Close, Volume Filter: ON
• Risk: SL ATR Min=1.5, SL Buffer=0.1
• TP1/TP2/TP3: 1R / 3R / 3.5R
MYM 5min (Long-Bias)
• Structure: Left=16, Right=4, Tol=0.4, Window=15, Age=35
• Reclaim Mode: Close, Volume Filter: ON
• Risk: SL ATR Min=1.0, SL Buffer=0.2
• TP1/TP2/TP3: 1R / 1.5R / 2R
POSITION SIZING
With `strategy.fixed`, position size meaning varies by instrument:
• Futures: Contracts (3 = 3 contracts)
• FX: Units (30000 = 0.3 lots)
• Crypto: Coins (0.1 = 0.1 BTC)
• Stocks: Shares (100 = 100 shares)
NOTES
• Position size must be divisible by 3 for Thirds exit to work correctly
• For FX: use units (30000), not lots (0.3)
• Sunday filter enabled by default to avoid FX gaps
• The "look-ahead bias" warning is a false positive — uses `lookahead=barmerge.lookahead_off`
• Commission/slippage set for futures — adjust in Properties for your instrument
• Margin set to 5% ($500/contract on $10K) — adjust as needed
Not financial advice. Always backtest on your specific instrument and timeframe.
Skrypt chroniony
Ten skrypt został opublikowany jako zamknięty kod źródłowy. Można z tego korzystać swobodnie i bez żadnych ograniczeń — więcej informacji znajduje się tutaj.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt chroniony
Ten skrypt został opublikowany jako zamknięty kod źródłowy. Można z tego korzystać swobodnie i bez żadnych ograniczeń — więcej informacji znajduje się tutaj.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.