Appearance
Personalize your experience
Squeeze Breakout
FreeTrades the expansion after a volatility squeeze
Live engine preview
The QuaScript engine's own output on the chart the terminal uses. Change the settings or edit the code and press Run to recompute it.
About
Enters when a Bollinger-inside-Keltner squeeze releases in the direction of momentum; exits on a Chandelier stop or after `max_bars` bars.
Settings
Length: 20
Max bars in trade: 40
Measured backtests
Run by the backtest engine on public candles, 2025-11-01 to 2026-11-01, with the script's own commission and slippage, on BTCUSDT 1h (Binance) and ETHUSDT 1h (Binance). The figures per market are in the Measured backtest panel below. Past results do not predict future returns.
Backtest it yourself
Open it on the backtesting page to run it on any symbol, interval and date range, then use Monte Carlo, optimisation, walk-forward and robustness tests.
Strategy Rules
Entry Conditions
Exit Conditions
Measured backtest
BTCUSDT 1h (Binance), 2025-11-01 to 2026-11-01 · backtest engine, script costs included
18.0%
Return
0.84
Sharpe
-14.4%
Max DD
39.7%
Win Rate
146
Trades
| Market | Trades | Return | Sharpe | Max DD | Win rate | Profit factor |
|---|---|---|---|---|---|---|
| BTCUSDT 1h | 146 | 18.0% | 0.84 | -14.4% | 39.7% | 1.19 |
| ETHUSDT 1h | 150 | 52.9% | 1.43 | -17.0% | 40.0% | 1.42 |
Past results on historical data do not predict future returns.
Source Code
Edit in IDE| 1 | strategy "Squeeze Breakout" { |
| 2 | overlay = true |
| 3 | capital = 25000 |
| 4 | commission = 0.02 |
| 5 | sizing = percent_equity |
| 6 | size = 95 |
| 7 | } |
| 8 | /// Enters when a Bollinger-inside-Keltner squeeze releases in the direction of momentum; |
| 9 | /// exits on a Chandelier stop or after `max_bars` bars. |
| 10 | len = param.int(20, title = "Length", min = 5) |
| 11 | max_bars = param.int(40, title = "Max bars in trade", min = 1) |
| 12 | |
| 13 | (_, bb_up, bb_lo) = ta.bollinger(close, len, 2.0) |
| 14 | (_, kc_up, kc_lo) = ta.keltner(close, len, 1.5, len) |
| 15 | on = bb_up < kc_up and bb_lo > kc_lo |
| 16 | released = on[1] and not on |
| 17 | (mom, _, _) = stat.linreg(close - ta.sma(close, len), len, 0) |
| 18 | (long_stop, short_stop) = ta.chandelier(22, 3.0) |
| 19 | |
| 20 | if position.size == 0 and released { |
| 21 | if mom > 0 { order.market("L", side.long) } |
| 22 | if mom < 0 { order.market("S", side.short) } |
| 23 | } |
| 24 | if position.size > 0 and (close < long_stop or position.bars_held >= max_bars) { exit.close("L") } |
| 25 | if position.size < 0 and (close > short_stop or position.bars_held >= max_bars) { exit.close("S") } |
| 26 | render.step(position.size > 0 ? long_stop : na, "Long stop", color = color.emerald.500) |
| 27 | render.step(position.size < 0 ? short_stop : na, "Short stop", color = color.rose.500) |
| 28 | render.background(on ? color.translucent(color.amber.500, 90) : na) |
| 29 | render.mark(released and mom > 0, shape = shape.arrow_up, at = anchor.below_bar, color = color.lime.400, text = "Release") |
| 30 | render.mark(released and mom < 0, shape = shape.arrow_down, at = anchor.above_bar, color = color.red.400, text = "Release") |
| 31 |
Reviews
No reviews yet. Be the first to review this listing.