Momentum Rotor | Basket Breakout & Leadership Rotation — Strategy by blitz_locked
By blitz_locked
Performance Metrics
- Author: blitz_locked
- Symbol: NASDAQ:TSLA
- Timeframe: 2 hours
- Win Rate: 46.1%
- Profit Factor: 1.645
Description
What it doesMomentum Rotor ranks a basket of correlated symbols (default: AAPL, MSFT, NVDA, GOOGL, AMZN, META, TSLA, AVGO — fully user-editable) by N-bar rate-of-change momentum, recalculated every bar via request.security(). It only opens a long position on the chart's own symbol when that symbol is simultaneously the strongest performer in the basket (rank #1 by momentum) and breaking its own N-bar price high. If the held symbol later loses the #1 rank to another basket member, the strategy closes the position — it "rotates out" of a fading leader rather than holding through a reversal.Core featuresLive leaderboard table — ranks the full basket by momentum every bar, with gradient-colored scores and trend glyphs (↑/↓) so you can see who's strengthening or fading at a glanceRegime/leadership dashboard — shows your symbol's current rank, how many bars the leader has held the top spot, and basket-wide breadth (% of symbols with positive momentum) as a quick risk-on/risk-off gaugeRisk-based position sizing — position size is calculated from a fixed % of equity risked against an ATR-based stop distance, not a fixed share countATR stop + R-multiple take-profit — stop distance and profit target both scale with volatility instead of using static price offsetsOptional rotation-confirmation filter — require the leader to lose #1 rank for N consecutive bars before exiting, to reduce whipsaw from brief rank flickersOptional regime filter — require price above a long SMA before taking new entries, to avoid trading breakouts in a broader downtrendRealistic backtest defaults — includes commission, slippage, and margin settings out of the box rather than assuming frictionless, infinite-leverage fillsHow the strategy worksEach bar, the script pulls the N-bar ROC (rate of change) for every symbol in the basket and sorts them from strongest to weakest. Your chart's symbol only becomes eligible to trade when it holds rank #1 and closes above its own N-bar high — combining a relative-strength filter with an absolute breakout trigger, so entries require both "stronger than its peers" and "breaking out on its own chart" to align. Exits are twofold: an ATR stop/target pair from the entry, and a rotation exit that closes the trade the moment (or, with the confirmation filter on, N bars after) another basket member overtakes it in the momentum ranking.What makes it distinctMost retail breakout scripts evaluate a single symbol in isolation. Momentum Rotor brings relative-strength rotation — a concept used by institutional sector/factor rotation strategies — into a single-chart script by polling an entire basket with request.security() and gating trade eligibility on relative rank, not just absolute price action. The live leaderboard turns that ranking process into something visible and auditable on the chart itself, rather than a black-box filter.Tips for useChart the strategy on one of the basket's own symbols (or add your target symbol to the basket inputs) — the "am I #1" check only works when your chart's ticker matches a basket entryThis instance only manages a position on its own chart's symbol; it does not automatically route orders to whichever symbol becomes the new leader. To rotate capital across the whole basket, run separate instances on each symbolMomentum/breakout systems are inherently prone to false breakouts and whipsaws in choppy markets — the optional regime filter and rotation-confirmation delay are there to dampen that; test both on/off for your instrument and timeframeSector ETFs (lower dispersion, steadier trends) and mega-cap tech names (higher dispersion, sharper momentum swings) behave differently in this framework — adjust lenMom/lenBreak accordinglyBacktest results depend heavily on commission, slippage, and margin assumptions set in Properties — review and adjust these to match your actual broker before drawing conclusionsLimitationsThis is an educational strategy template, not a production-ready system or financial advice. It has not been optimized or validated for any specific instrument, timeframe, or market regime. Past performance in this backtest does not indicate future results.