OPEN-SOURCE SCRIPT
BitLogic - Kalman Composite

BitLogic Kalman Composite (BL-KC)
What it is
A momentum/condition oscillator that filters price with a multi-stage Kalman and blends two normalized branches into one composite line with a compact score histogram. Built for cleaner flips and fewer whipsaws.
How it works
Inputs you’ll care about
Reading it
Tips
Credits
Inspired by the community idea behind the Kalman Synergy Oscillator (Kalman + RSI + %R). This is an independent, from-scratch implementation with a residual z-score branch and gain-weighted blending for distinct behavior.
Disclaimer
For educational purposes only. Not financial advice. Past performance does not guarantee future results.
What it is
A momentum/condition oscillator that filters price with a multi-stage Kalman and blends two normalized branches into one composite line with a compact score histogram. Built for cleaner flips and fewer whipsaws.
How it works
- Kalman filter (5-stage) on your chosen price source; selectable output (Stage1/Stage5/Average).
- Branch A: RSI on Kalman price → normalized to ~[−0.5, +0.5].
- Branch B (selectable):
- Residual Z: z-score of the Kalman residual (observation − predicted state), squashed for
stability (distinct vs classic KSO)
- Williams %R on Kalman price (normalized). - Gain-weighted blend: the composite weights Branch B by the average Kalman gain (when the filter trusts new info more, residual matters more).
- Zero-line hysteresis: small band around 0 to reduce flip noise.
- Score (columns): quadrant logic → 1, 0.5, −0.5, −1 for quick read of bias + slope.
- No repainting: updates/alerts on bar close.
Inputs you’ll care about
- Q/R (process/measurement noise): responsiveness vs smoothness.
- Blend: base weight + gain weighting.
- Residual Z: lookback & squash scale (controls sensitivity).
- Hysteresis band and optional EMA smoothing of the composite.
Reading it
- Line (ci): above 0 → bullish zone; below 0 → bearish zone.
- Columns (KC_score): show strength/weakness inside each zone (green ≥ 0, orange < 0).
- Alerts: bullish/bearish flip fire on close when the composite crosses the band edges.
Tips
- For faster markets: raise Q, lower smoothing, keep a small hysteresis (e.g., 0.03–0.05).
- For trend following: use Stage5/Average Kalman output and a slightly wider band (0.06–0.10).
- Want “classic” feel? Switch Branch B to Williams %R.
Credits
Inspired by the community idea behind the Kalman Synergy Oscillator (Kalman + RSI + %R). This is an independent, from-scratch implementation with a residual z-score branch and gain-weighted blending for distinct behavior.
Disclaimer
For educational purposes only. Not financial advice. Past performance does not guarantee future results.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。