OPEN-SOURCE SCRIPT
Kalman Flow | Lyro RS

The Kalman Flow is an adaptive trend-following tool designed to identify and track market direction by combining a two-state Kalman filter with noise-scaled deviation bands. Unlike traditional moving-average systems, this indicator estimates both the underlying price level and its velocity (drift per bar) simultaneously, requiring agreement between price displacement and directional drift before confirming a trend change.
How It Works
1. Kalman Baseline [Level + Velocity]
This is the core engine of the indicator — a constant-velocity Kalman filter that recursively predicts the next price level from its current level and velocity states, then corrects the prediction using actual price. Because the filter gain depends only on the process-to-measurement noise ratio, behavior is consistent across all assets and price scales.
2. Adaptive Noise Bands
Instead of ATR or standard deviation, the bands are scaled by the filter's own tracking error — the average absolute distance between price and the Kalman estimate.
The two multipliers are independent, allowing asymmetric tuning of bullish and bearish flip thresholds. The bands automatically widen in choppy conditions and tighten in clean trends, so flips require a move that is large relative to recent noise — not a fixed size.
3. Velocity-Confirmed Trend Engine
A trend flip requires both conditions at once:
Anything less holds the current state, creating built-in hysteresis that filters out displacement without follow-through.
Practical Application
Signal Interpretation
Trend Confirmation
The velocity requirement serves as a confirmation layer — a single spike through a band without genuine drift behind it will not flip the trend, reducing the likelihood of false signals during choppy or low-volatility conditions. Built-in alerts cover bullish flips, bearish flips, and any flip.
⚠️ Disclaimer
This indicator is a technical analysis tool and does not guarantee results. It should be used in conjunction with additional analysis methods and proper risk management strategies. The creators of this indicator are not responsible for any financial decisions made based on its signals.
How It Works
1. Kalman Baseline [Level + Velocity]
This is the core engine of the indicator — a constant-velocity Kalman filter that recursively predicts the next price level from its current level and velocity states, then corrects the prediction using actual price. Because the filter gain depends only on the process-to-measurement noise ratio, behavior is consistent across all assets and price scales.
- Higher Sensitivity → the baseline tracks price closely and reacts faster.
- Lower Sensitivity → a smoother baseline with fewer, more selective flips.
2. Adaptive Noise Bands
Instead of ATR or standard deviation, the bands are scaled by the filter's own tracking error — the average absolute distance between price and the Kalman estimate.
- Upper Band = Kalman Baseline + (Tracking Error × + Multiplier)
- Lower Band = Kalman Baseline − (Tracking Error × − Multiplier)
The two multipliers are independent, allowing asymmetric tuning of bullish and bearish flip thresholds. The bands automatically widen in choppy conditions and tighten in clean trends, so flips require a move that is large relative to recent noise — not a fixed size.
3. Velocity-Confirmed Trend Engine
A trend flip requires both conditions at once:
- A close beyond the opposite noise band (displacement).
- Kalman velocity agreeing with the new direction (drift).
Anything less holds the current state, creating built-in hysteresis that filters out displacement without follow-through.
Practical Application
Signal Interpretation
- A Long signal is generated when price closes above the upper band while Kalman velocity is positive.
- A Short signal is generated when price closes below the lower band while Kalman velocity is negative.
- Candle coloring and the baseline color always reflect the current trend state.
Trend Confirmation
The velocity requirement serves as a confirmation layer — a single spike through a band without genuine drift behind it will not flip the trend, reducing the likelihood of false signals during choppy or low-volatility conditions. Built-in alerts cover bullish flips, bearish flips, and any flip.
⚠️ Disclaimer
This indicator is a technical analysis tool and does not guarantee results. It should be used in conjunction with additional analysis methods and proper risk management strategies. The creators of this indicator are not responsible for any financial decisions made based on its signals.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
Get access to our private indicators: whop.com/lyro-rs
Join our community: discord.gg/kcEBMWaFjS
Join our community: discord.gg/kcEBMWaFjS
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
Get access to our private indicators: whop.com/lyro-rs
Join our community: discord.gg/kcEBMWaFjS
Join our community: discord.gg/kcEBMWaFjS
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。