OPEN-SOURCE SCRIPT

Multi Cycle KST Oscillator

359
Multi-Cycle KST Oscillator — Publication Description

What it does

The Multi-Cycle KST Oscillator is a momentum oscillator built on the Know Sure Thing (KST) — a summed, weighted blend of four smoothed Rate-of-Change series. The standard KST plots one line. This script computes three KSTs at short, intermediate and long cycle lengths, reads their alignment, and wraps the plotted short-term KST in five decision-support modules so the momentum reading is filtered, contextualized and scored rather than read at face value. A single 0–100 Confidence value summarizes everything, and the oscillator line is colored by it.

Why these components are combined (the reason for the mashup)

KST on its own is a momentum (rate-of-change) factor, and it lags by construction. Adding more momentum tools such as RSI, MACD or Stochastic would only restate the same information. So every module added here is deliberately orthogonal to momentum — each answers a question the KST cannot answer by itself:


Long-term KST direction — the regime gate. A slower KST decides which side to trade. Short-term buy crosses are only trusted when the long-term cycle is rising, short crosses only when it is falling. This is the core of the multi-cycle idea: trade the shorter cycle in the direction of the longer one.
ADX/DMI regime filter — trade only in a real trend. Momentum crosses whipsaw in sideways markets, so signals are suppressed and the background is shaded while ADX is below threshold.
Higher-timeframe filter — alignment with the bigger picture. The same momentum direction is read from a higher, confirmed (non-repainting) timeframe to drop counter-trend crosses.
Price/KST divergence — early warning. Because the oscillator measures momentum, a price high against a lower oscillator high (or the inverse) flags fading momentum before the signal-line cross. Regular and hidden divergences are detected from confirmed pivots.
Efficiency-Ratio conviction scaler — how much to trust it now. A Kaufman Efficiency Ratio scales the Confidence up in clean trends and down in chop. It is a magnitude scaler, never a direction vote, so it cannot double-count momentum.


How the parts work together

Each module feeds one combined output. The plotted oscillator is the short-term KST (optionally standardized). A Buy or Sell is raised only when the short-term KST crosses its signal line AND the long-term cycle agrees AND the regime and higher-timeframe filters agree AND Confidence clears its threshold. Confidence itself is a weighted vote across the four orthogonal inputs (KST-vs-signal, long-term direction, price location, divergence), scaled by the Efficiency Ratio and clamped to 0–100. Divergence labels and the ATR stop/target are context around that one decision.

What makes it original

It is not a KST with other indicators drawn beside it. It turns a single KST line into a three-cycle alignment model with a long-term regime gate, then standardizes the result so its bands carry a consistent statistical meaning across instruments, and fuses five orthogonal checks into one bounded Confidence reading with explicit buy/sell gating. The combined output — "is momentum turning, in a real trend, in line with the larger cycle, and how much should I trust it" — does not exist in the source indicator.

How to use it


Pick an Oscillator mode: Raw (native KST), Z-Score, or Robust Z (median/MAD, least sensitive to spikes).
Green = up-cycle momentum, red = down-cycle; further from zero and brighter = stronger and higher conviction. Warn / Extreme bands mark stretched readings.
Buy / Sell triangles fire only when the cross, the long-term gate, the regime and higher-timeframe filters, and the Confidence threshold all agree. Treat them as points to investigate, not automatic entries.
Use divergences as early warning of fading momentum, and the two dashboards for the full read: right panel = Bias, Confidence, Signal, Cycle alignment, Oscillator; left panel = Long-term KST, Regime, Divergence, ATR Stop and Target.
The dashboards adapt to your chart's background brightness so both stay legible on dark or light themes.


Settings and defaults

Inputs are grouped and numbered: Data Source, the three KST cycles, Normalization & Display, Threshold Bands, Confirmation Filters, Divergence, Confidence Engine, Risk Targets, Signals & Alerts, and Visuals & Dashboard. Defaults follow the classic KST values and are tuned for NSE NIFTY on intraday charts. Because the Price / High / Low sources are user-selectable, the engine works on any instrument or even another indicator's output — for other assets, adjust the ROC/SMA lengths, the higher timeframe and the ATR period to suit.

Concept credit

The Know Sure Thing (KST) oscillator was created by Martin J. Pring. This script is an original multi-cycle implementation built around that public concept and is not affiliated with, nor endorsed by, its originator.

Honest limitations

KST is lagging by construction; this confirms moves, it does not predict them. Confidence (0–100) is an ordinal heuristic for how aligned the components are — it is not a probability or a win rate. Divergence is computed on confirmed pivots and therefore prints a few bars after the pivot forms; that latency is inherent to honest pivot detection. Signals confirm on bar close (non-repainting) by default, and the higher-timeframe filter uses the previous confirmed higher-timeframe bar. Backtest any settings on your own market before relying on them.

Disclaimer

For research and educational purposes only. This is not financial advice, not an investment recommendation, and not a solicitation to trade. Indicators describe past price behavior; they do not predict the future. Trading involves substantial risk of loss. Test on out-of-sample data and make your own decisions. The author accepts no liability for any use of this script.

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.