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提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。