OPEN-SOURCE SCRIPT

StackLight MTF | MTF Momentum Stack + Stochastic Confluence

2 077
The strategy only fires a signal when three timeframes of your choosing — fast, medium, and slow — all agree on direction. Each timeframe is scored bullish, bearish, or neutral using either RSI or EMA slope, and displayed as a live 3-light traffic signal in the corner of your chart. Green means go, red means no — and when all three lights match, the strategy arms itself for entry.
Once the stack is aligned, entries are triggered by a stochastic %K/%D crossover on your chart timeframe, confirmed by a linreg-smoothed stochastic on your slowest timeframe — so you're not just trading a momentum cross in isolation, you're trading one that's backed by higher-timeframe agreement.

Risk is handled with ATR-based stops and targets, and position size adjusts automatically so every trade risks a fixed percentage of your account — no more, no less — regardless of how wide or tight the current stop distance is. An optional "stack flip" exit closes trades early if the multi-timeframe alignment breaks down before your stop is hit, cutting losers faster than a static stop alone.

Features
  • 3-light traffic signal table — instant visual read of alignment across your fast/medium/slow timeframes
  • Dual momentum modes — RSI (with adjustable neutral band to reduce flip-flopping) or EMA slope
  • Linreg-smoothed MTF stochastic — filters out the staircase artifact from pulling higher-timeframe data
  • Bias label — STRONG BULL / BULL LEAN / NEUTRAL / BEAR LEAN / STRONG BEAR at a glance
  • Background tint + bar coloring — full-chart visual confirmation, not just the indicator pane
  • Risk-based position sizing — fixed % equity risk per trade, auto-scaled to current ATR
  • ATR stop/target + stack-flip early exit — two independent exit mechanisms
  • Built-in alert conditions for long/short signals — ready for automation
  • Long-only, short-only, or both — directional bias control in one input

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.