OPEN-SOURCE SCRIPT

Kase Convergence Divergence [BackQuant]

249
Kase Convergence Divergence [BackQuant]

The Kase Convergence Divergence [BackQuant] is a sophisticated oscillator designed to measure directional market strength through the lens of volatility-adjusted log return structures. Inspired by Cynthia Kase’s work on statistical momentum and price projection ranges, this unique indicator offers a hybrid framework that merges signal processing, multi-length sweep logic, and adaptive smoothing techniques.

Unlike traditional momentum oscillators like MACD or RSI, which rely on static moving average differences, KCD [BackQuant] introduces a dual-process system combining:

Kase-style statistical range projection (via log returns and volatility),

A sweeping loop of lookback lengths for robustness,

First and second derivative modes to capture both velocity and acceleration of price movement.

Core Logic & Computation
The KCD calculation is centered on two volatility-normalized transforms:

KSDI Up: Measures how far the current high has moved relative to a past low, normalized by return volatility.

KSDI Down: Measures how far the current low has moved relative to a past high, also normalized.

For every length in a user-defined sweep range (e.g., 25–35), both KSDI_up and KSDI_dn are computed, and their maximum values across the loop are retained. The difference between these two max values produces the raw signal:

KPO (Kase Projection Oscillator): Measures directional skew.

KCD (Kase Convergence Divergence): Defined as KPO – MA(KPO) — similar in spirit to MACD but structurally different.

Users can choose to visualize either the first derivative (KPO), or the second derivative (KCD), depending on market conditions or strategy style.

Key Features
Multi-Length Sweep Logic: Improves signal reliability by aggregating statistical range projections across a set of lookbacks.
Advanced Smoothing Modes: Supports DEMA, HMA, TEMA, LINREG, WMA and more for dynamic adaptation.
Dual Derivative Modes: Choose between speed (first derivative) or smoothness (second derivative) to fit your trading regime.
Color-Encoded Signal Bands: Heatmap-style oscillator coloring enhances visual feedback on trend strength.
Candlestick Painting: Optional bar coloring makes it easy to spot trend shifts on the main chart.
Adaptive Fill Zones: Green and red fills between the oscillator and zero line help distinguish bullish and bearish regimes at a glance.

Practical Applications
📈 Trend Confirmation: Use KCD as a secondary confirmation layer after breakout or pullback entries.
📉 Momentum Shifts: Crossover and crossunder of the zero line highlight potential regime changes.
📊 Strategy Filters: Incorporate into algos to avoid trendless or mean-reverting environments.
🧪 Derivative Switching: Flip between KPO and KCD modes depending on whether you want to measure acceleration or deceleration of price flow.

Alerts & Signals
Two built-in alerts help you catch regime shifts in real time:

Long Signal: Triggered when the selected oscillator crosses above zero.
Short Signal: Triggered when it crosses below zero.

These events can be used to generate entries, exits, or trend validation cues in multi-layer systems.

Conclusion
The Kase Convergence Divergence [BackQuant] goes beyond traditional oscillators by offering a volatility-normalized, derivative-aware signal engine with enhanced visual dynamics. Its sweeping architecture and dynamic fill logic make it especially powerful for identifying trending environments, filtering chop, and adding statistical rigor to your trading toolkit.

Whether you’re a discretionary trader seeking precision, or a quant looking to model more robust return structures, KCD offers a creative yet analytically grounded solution.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.