OPEN-SOURCE SCRIPT
Swing Breakout Strategy (quant-core)

A trend-continuation system for swing trading. It buys volume-confirmed breakouts to new multi-week highs — but only when the broader trend structure agrees, which filters out the low-quality breakouts that tend to fail.
Entry (all must align):
Close breaks above the prior 50-day high
Volume ≥ 1.5× its 50-day average (conviction)
Uptrend filter: price above both the 50- and 200-day MAs, with the 50-day above the 200-day (golden cross)
Orders fill at the next bar's open (no same-bar lookahead).
Exit: a gap-honest ATR trailing stop — it trails 4× ATR below the highest price reached since entry and ratchets up as the trade works, letting winners run while capping downside. Gaps through the stop fill at the open, not an idealized level.
On the chart: 50/200 MAs, the live trailing stop, BUY markers, an uptrend-regime shade, and alerts for both fresh breakouts and "developing" setups approaching their breakout level.
All inputs (breakout length, volume multiple, MA lengths, ATR multiple) are adjustable. Designed for daily/swing timeframes and works on any liquid symbol.
Educational tool, not financial advice. Backtest results don't guarantee future performance — test and size to your own risk.
Entry (all must align):
Close breaks above the prior 50-day high
Volume ≥ 1.5× its 50-day average (conviction)
Uptrend filter: price above both the 50- and 200-day MAs, with the 50-day above the 200-day (golden cross)
Orders fill at the next bar's open (no same-bar lookahead).
Exit: a gap-honest ATR trailing stop — it trails 4× ATR below the highest price reached since entry and ratchets up as the trade works, letting winners run while capping downside. Gaps through the stop fill at the open, not an idealized level.
On the chart: 50/200 MAs, the live trailing stop, BUY markers, an uptrend-regime shade, and alerts for both fresh breakouts and "developing" setups approaching their breakout level.
All inputs (breakout length, volume multiple, MA lengths, ATR multiple) are adjustable. Designed for daily/swing timeframes and works on any liquid symbol.
Educational tool, not financial advice. Backtest results don't guarantee future performance — test and size to your own risk.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.