OPEN-SOURCE SCRIPT
Kairi Trend Oscillator [T3][T69]

📌 Overview
The Kairi Trend Oscillator [T3][T69] is a Japanese-inspired hybrid oscillator combining Heikin-Ashi trend clarity with the Kairi (乖離率) indicator — a measure of price deviation from a moving average. This dual-layer system gives you both trend direction and trend strength/health, designed to highlight trend maturity and avoid overextended entries.
✨ Features
⚙️ How to Use
🔧 Configuration
Inputs:
🧪 Advanced Tips
⚠️ Limitations
📌 Disclaimer
This script is educational and illustrative. Always backtest thoroughly before using in live markets.
The Kairi Trend Oscillator [T3][T69] is a Japanese-inspired hybrid oscillator combining Heikin-Ashi trend clarity with the Kairi (乖離率) indicator — a measure of price deviation from a moving average. This dual-layer system gives you both trend direction and trend strength/health, designed to highlight trend maturity and avoid overextended entries.
✨ Features
- Heikin-Ashi or normal candlestick input modes
- Multiple moving average options: SMA, EMA, DEMA, VWMA, and Kijun
- Visual color-coded trend zones: overbought, oversold, healthy, weak, and reversal conditions
- Full Kairi column plot with dynamic coloring
- Adaptive logic for trend detection (linear regression or Heikin-Ashi structure)
- Built-in reversal detection based on divergence between Kairi and trend direction
⚙️ How to Use
- Choose Candle Type: Select Heiken Ashi or Normal Candlesticks via the Candle Mode dropdown.
- Select Source: Choose open, high, low, or close as the input for Kairi computation.
- Set MA Type & Length: Configure the moving average mode and its length under Moving Average Settings.
- Interpret the Plot:
- Green/Red bars: Show Kairi oscillator values above/below 0
- Background color: Shows current trend (green = uptrend, red = downtrend)
- Candle color overlays:
- 🟩 Teal = Overextended Bulls
- 🟥 Maroon = Overextended Bears
- ✅ Green = Healthy Uptrend
- 🔻 Red = Healthy Downtrend
- 🟨 Light tones = Weak trends
- 🔄 Blue/Fuchsia = Possible reversal detected
- 🟩 Teal = Overextended Bulls
- Green/Red bars: Show Kairi oscillator values above/below 0
🔧 Configuration
Inputs:
- Candle Mode: Heiken Ashi or Normal Candle Sticks
- Source: Open, High, Low, Close
- MA Mode: SMA, EMA, DEMA, VWMA, or Kijun
- MA Length: Default is 29
🧪 Advanced Tips
- Use Heikin-Ashi mode for better trend smoothing.
- Kairi divergence (e.g., bullish Kairi in a downtrend) may signal upcoming reversal — watch for blue or fuchsia bars.
- Combine with momentum indicators (e.g. RSI or MACD) for confluence-based setups.
- For mean reversion strategies, fade extreme Kairi readings (> ±5%).
⚠️ Limitations
- Not suited for ranging markets without trend.
- Kairi extremes may remain elevated in strong trends — avoid early counter-trend entries.
- Reversal logic is not a confirmation signal; use with caution.
📌 Disclaimer
This script is educational and illustrative. Always backtest thoroughly before using in live markets.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.