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
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.