OPEN-SOURCE SCRIPT
Compression Breakout System

WHAT IT DOES
CBS trades the volatility cycle on daily bars. Volatility is cyclical: compression precedes expansion. The system waits for a statistically quiet base, buys the first range break that comes with real participation, and rides the expansion leg on a wide trail. Long-only, designed for trending large-caps and liquid index ETFs.
HOW IT WORKS
1) COMPRESSION DETECTION — Bollinger Band width (20, 2) is expressed as a percentage of the basis and ranked against its own trailing 126-day distribution. A "squeeze" is a bottom-quartile reading (width percentile rank below 25). Because this is a percentile rank rather than an absolute width threshold, it self-normalizes across symbols and volatility regimes — nothing to re-tune per asset.
2) TRIGGER — a close above the prior 20-day high, within 5 bars of the last squeeze reading, on above-average volume (volume above its 20-day mean), while price holds above the 200-day SMA. Location plus participation plus trend — no prediction.
3) POSITION SIZING — fixed-fractional: each trade risks a configurable percentage of equity (default 4%), with the position sized off the 2-ATR stop distance and capped at 100% of equity. Volatile symbols automatically get smaller positions, and a failed breakout always costs roughly the same fraction of the account.
4) EXITS — a hard stop 2 ATR under entry (failed break = thesis falsified), and a 3-ATR chandelier trail from the high-water mark. There is deliberately no profit target: expansion legs are long-tailed and the trail, not a target, books them.
BACKTEST PROPERTIES (fully disclosed)
All results use 0.05% commission per side, 1 tick slippage, fills on close of the signal bar, $10,000 initial capital. On AAPL daily 2005-2026 the default configuration shows +899% net, profit factor 4.33, 59% winners, max drawdown 14.4%. Split-sample with parameters frozen: 2005-2015 +164% (PF 3.35), 2015-2026 +293% (PF 4.97). Slippage stress at 5 ticks per side: +256% (PF 4.77). Cross-symbol with frozen parameters: NVDA +658% (PF 3.26); MSFT +46% (PF 1.32) — the honest miss: the system needs names that actually produce post-squeeze expansion, and low-volatility grinders barely clear costs.
WHAT WAS TESTED AND REJECTED
100%-of-equity sizing was rejected: the identical signal stack produced an 89% drawdown in AAPL's choppy pre-2005 era. Risk sizing is what turns a signal into a system. The backtest start/end inputs exist so any subperiod can be scored from the settings dialog without touching code.
INPUTS
Bollinger length and multiplier; width rank window; squeeze threshold and age; breakout lookback; trend SMA length; ATR length; initial stop multiple; chandelier trail multiple; risk % per trade; backtest start/end dates.
LIMITATIONS
These are in-sample backtests on liquid US equities — upper bounds on expectancy, not forecasts. The system trades infrequently (roughly 2-3 trades per year per symbol) and holds through pullbacks by design. Validate on your own symbols and windows before relying on it. Not financial advice.
CBS trades the volatility cycle on daily bars. Volatility is cyclical: compression precedes expansion. The system waits for a statistically quiet base, buys the first range break that comes with real participation, and rides the expansion leg on a wide trail. Long-only, designed for trending large-caps and liquid index ETFs.
HOW IT WORKS
1) COMPRESSION DETECTION — Bollinger Band width (20, 2) is expressed as a percentage of the basis and ranked against its own trailing 126-day distribution. A "squeeze" is a bottom-quartile reading (width percentile rank below 25). Because this is a percentile rank rather than an absolute width threshold, it self-normalizes across symbols and volatility regimes — nothing to re-tune per asset.
2) TRIGGER — a close above the prior 20-day high, within 5 bars of the last squeeze reading, on above-average volume (volume above its 20-day mean), while price holds above the 200-day SMA. Location plus participation plus trend — no prediction.
3) POSITION SIZING — fixed-fractional: each trade risks a configurable percentage of equity (default 4%), with the position sized off the 2-ATR stop distance and capped at 100% of equity. Volatile symbols automatically get smaller positions, and a failed breakout always costs roughly the same fraction of the account.
4) EXITS — a hard stop 2 ATR under entry (failed break = thesis falsified), and a 3-ATR chandelier trail from the high-water mark. There is deliberately no profit target: expansion legs are long-tailed and the trail, not a target, books them.
BACKTEST PROPERTIES (fully disclosed)
All results use 0.05% commission per side, 1 tick slippage, fills on close of the signal bar, $10,000 initial capital. On AAPL daily 2005-2026 the default configuration shows +899% net, profit factor 4.33, 59% winners, max drawdown 14.4%. Split-sample with parameters frozen: 2005-2015 +164% (PF 3.35), 2015-2026 +293% (PF 4.97). Slippage stress at 5 ticks per side: +256% (PF 4.77). Cross-symbol with frozen parameters: NVDA +658% (PF 3.26); MSFT +46% (PF 1.32) — the honest miss: the system needs names that actually produce post-squeeze expansion, and low-volatility grinders barely clear costs.
WHAT WAS TESTED AND REJECTED
100%-of-equity sizing was rejected: the identical signal stack produced an 89% drawdown in AAPL's choppy pre-2005 era. Risk sizing is what turns a signal into a system. The backtest start/end inputs exist so any subperiod can be scored from the settings dialog without touching code.
INPUTS
Bollinger length and multiplier; width rank window; squeeze threshold and age; breakout lookback; trend SMA length; ATR length; initial stop multiple; chandelier trail multiple; risk % per trade; backtest start/end dates.
LIMITATIONS
These are in-sample backtests on liquid US equities — upper bounds on expectancy, not forecasts. The system trades infrequently (roughly 2-3 trades per year per symbol) and holds through pullbacks by design. Validate on your own symbols and windows before relying on it. Not financial advice.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。