OPEN-SOURCE SCRIPT
Momentum Bands | Breakout

This strategy hunts for N-bar breakouts confirmed by volume expansion — but instead of trading every breakout blindly (like a standard Opening Range or Donchian breakout), it runs price through a trend filter and an RSI momentum check first. Breakouts that align with the EMA trend and show accelerating RSI get traded as genuine continuation moves. Breakouts that fire against the prevailing trend, with RSI already rolling over, get treated as exhaustion — and faded instead of chased. Built-in ATR-based position sizing and a trailing stop round it out into a complete, risk-managed system rather than just a signal generator.
Key Features
How It Works
Tips
Key Features
- Trend-gated entries — EMA fast/slow cross defines regime; longs only trade with the trend, fades only trade against it
- Volume-confirmed breakouts — requires expansion above the rolling volume average, not just a price poke
- RSI momentum-exhaustion filter — distinguishes accelerating momentum (real breakout) from divergence (fakeout)
- ATR-based risk sizing — position size auto-scales to a fixed % of equity risked, using ATR-derived stop distance
- ATR trailing stop — lets winners run instead of capping them at a fixed target
- Glowing ATR bands — layered, fading visual bands around trend basis for at-a-glance regime read
- Breakout candle highlighting — candles color-shift on signal and while a position is open
- Live + archived trailing-stop path — see the stop while a trade is open, and its full trail once closed
How It Works
- Price breaks above the highest high of the last N bars with volume above its rolling average — that's the breakout trigger.
- EMA fast vs. slow defines trend direction.
- RSI and its rate of change are checked at the breakout bar: still climbing and near its own recent peak = momentum confirms. Already fading or below its recent peak = momentum diverges.
- Confirmed + with-trend → long. Diverging + against-trend → short (fade).
- Every entry is sized off account risk %, not a fixed share count, and exits on an ATR stop plus ATR trailing stop.
Tips
- Backtest across multiple symbols and volatility regimes before trusting the defaults — breakout/fade systems behave very differently in trending vs. choppy markets
- Widen nLen (breakout lookback) on lower timeframes to reduce noise-driven false breakouts
- If fades are underperforming, try disabling allowShorts and running long-only to isolate performance
- Tighten rsiConfirmLvl for higher-conviction (fewer, cleaner) long signals
- Use the glowing bands as a quick visual regime check even when not actively watching signals
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。