OPEN-SOURCE SCRIPT
KRT Kalman Regime Tricolor

# 📊 KRT — Kalman Regime · Tricolor
**Designed and statistically validated for 🥇 GOLD and Ξ ETHEREUM.** A regime compass, not a buy signal: KRT reads the market on three layers — background regime, trend, your candle — and shows you which way the wind blows at every moment: 🟢 long · 🔴 short · 🔵 wait.
**⚡ ZERO lookahead, ZERO repaint.** Every signal appears in real time using only the information available at that moment, and whatever is printed at a bar close never changes afterwards. Many indicators look perfect because they quietly redraw the past — KRT is built for the opposite: what you see in replay is exactly what you would have seen live.
## ⚡ Quick start (30 seconds)
The colored BACKGROUND = the underlying regime.
Green 🟢 = bull regime installed → longs carry. Red 🔴 = bear regime installed → shorts carry. No color = no regime → caution.
The CURVE trails price like a stop line: below the candles in an uptrend, above them in a downtrend. Price crossing the curve = the reversal.
The curve's intensity = the strength of the authorization.
BRIGHT = trend aligned with the regime. Pale = secondary bias only. Blue = wait.
THE MARKERS — one single rule:
SOLID green or red marker (big triangle OR diamond) = GO. Blue = wait. Small = provisional.
🟢▲ / 🔴▼ BIG triangle — GO: reversal confirmed AND regime aligned.
🟢◆ / 🔴◆ Diamond — Deferred GO: the regime installs while the trend already points that way (often follows a big blue triangle). Same strength as a big colored triangle.
🔵▲ / 🔵▼ BIG blue triangle — reversal confirmed but no regime behind it → wait (a diamond will tell you if it becomes a GO).
▵▿ Small triangles (any color) — early alerts on your chart, ahead of confirmation. Provisional.
No thinking required: solid + colored = apply your strategy · blue = patience · small = not yet.
Drop it on gold or Ethereum, chart timeframe 5m–15m. Run YOUR strategy on top: KRT gives the direction, you handle entries, stops and exits.
## ⚠️ Before you use it
This is an indicator, NOT a strategy: it provides no entry or exit points.
Validated with permutation tests on gold and Ethereum. On Bitcoin the detection displays but the statistical edge is not demonstrated; on major forex pairs it is absent. Test it yourself before using it elsewhere.
The background regime changes slowly (weeks): that is by design — it filters, it does not scalp.
## 🔍 Understanding the display (going deeper)
THE THREE LAYERS
Regime (background, default 8H) — a slow Kalman trend filter with hysteresis: the background only colors once the regime is installed (default 3 days, adjustable). Locked at its own bar close: it does not flicker and does not repaint.
Trend (curve, default 1H) — the exact price level that would flip the trend filter, computed in advance: the distance between price and curve measures the strength of the trend.
Your candle (the chart) — the curve is monitored at your chart's granularity: you see the flip before the 1H close (small triangles), the close confirms it (big triangles).
HOW TO READ IT
Green background + bright green curve + GO = every layer agrees: the most favorable long context. Mirror in red for shorts.
Pale green curve = uptrend without an installed regime — weak bias.
Pale red curve = intraday "breather" (recurring windows of weakness inside an uptrend) — a short-lived bias, not an invitation to swing short.
Blue = no statistical edge. The best trade is often no trade.
After a bullish GO, price often retests the curve before continuing: aim for the retest rather than the impulse.
TIMEFRAMES & SETTINGS
Chart from 1m to 1H (5m–15m recommended).
Trend TF / Regime TF: the only settings an advanced user may change (swing trading: 4H/D).
Regime installation age (default 72h): higher = rarer, more reliable background; lower = more reactive, more false regimes.
Everything else (q values, thresholds, windows): the calibrated and validated core of the model — keep the defaults.
---
KRT is a decision-support tool based on historical data. Past performance does not guarantee future results. Manage your risk.
**Designed and statistically validated for 🥇 GOLD and Ξ ETHEREUM.** A regime compass, not a buy signal: KRT reads the market on three layers — background regime, trend, your candle — and shows you which way the wind blows at every moment: 🟢 long · 🔴 short · 🔵 wait.
**⚡ ZERO lookahead, ZERO repaint.** Every signal appears in real time using only the information available at that moment, and whatever is printed at a bar close never changes afterwards. Many indicators look perfect because they quietly redraw the past — KRT is built for the opposite: what you see in replay is exactly what you would have seen live.
## ⚡ Quick start (30 seconds)
The colored BACKGROUND = the underlying regime.
Green 🟢 = bull regime installed → longs carry. Red 🔴 = bear regime installed → shorts carry. No color = no regime → caution.
The CURVE trails price like a stop line: below the candles in an uptrend, above them in a downtrend. Price crossing the curve = the reversal.
The curve's intensity = the strength of the authorization.
BRIGHT = trend aligned with the regime. Pale = secondary bias only. Blue = wait.
THE MARKERS — one single rule:
SOLID green or red marker (big triangle OR diamond) = GO. Blue = wait. Small = provisional.
🟢▲ / 🔴▼ BIG triangle — GO: reversal confirmed AND regime aligned.
🟢◆ / 🔴◆ Diamond — Deferred GO: the regime installs while the trend already points that way (often follows a big blue triangle). Same strength as a big colored triangle.
🔵▲ / 🔵▼ BIG blue triangle — reversal confirmed but no regime behind it → wait (a diamond will tell you if it becomes a GO).
▵▿ Small triangles (any color) — early alerts on your chart, ahead of confirmation. Provisional.
No thinking required: solid + colored = apply your strategy · blue = patience · small = not yet.
Drop it on gold or Ethereum, chart timeframe 5m–15m. Run YOUR strategy on top: KRT gives the direction, you handle entries, stops and exits.
## ⚠️ Before you use it
This is an indicator, NOT a strategy: it provides no entry or exit points.
Validated with permutation tests on gold and Ethereum. On Bitcoin the detection displays but the statistical edge is not demonstrated; on major forex pairs it is absent. Test it yourself before using it elsewhere.
The background regime changes slowly (weeks): that is by design — it filters, it does not scalp.
## 🔍 Understanding the display (going deeper)
THE THREE LAYERS
Regime (background, default 8H) — a slow Kalman trend filter with hysteresis: the background only colors once the regime is installed (default 3 days, adjustable). Locked at its own bar close: it does not flicker and does not repaint.
Trend (curve, default 1H) — the exact price level that would flip the trend filter, computed in advance: the distance between price and curve measures the strength of the trend.
Your candle (the chart) — the curve is monitored at your chart's granularity: you see the flip before the 1H close (small triangles), the close confirms it (big triangles).
HOW TO READ IT
Green background + bright green curve + GO = every layer agrees: the most favorable long context. Mirror in red for shorts.
Pale green curve = uptrend without an installed regime — weak bias.
Pale red curve = intraday "breather" (recurring windows of weakness inside an uptrend) — a short-lived bias, not an invitation to swing short.
Blue = no statistical edge. The best trade is often no trade.
After a bullish GO, price often retests the curve before continuing: aim for the retest rather than the impulse.
TIMEFRAMES & SETTINGS
Chart from 1m to 1H (5m–15m recommended).
Trend TF / Regime TF: the only settings an advanced user may change (swing trading: 4H/D).
Regime installation age (default 72h): higher = rarer, more reliable background; lower = more reactive, more false regimes.
Everything else (q values, thresholds, windows): the calibrated and validated core of the model — keep the defaults.
---
KRT is a decision-support tool based on historical data. Past performance does not guarantee future results. Manage your risk.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.