OPEN-SOURCE SCRIPT
KAI LINES

**KAI LINES — Smart Money Market Structure & Trade Plan Indicator**
KAI LINES is an all-in-one market structure and trade planning indicator designed to help traders identify potential trend shifts, continuation moves, entry areas, stop-loss levels, and profit targets directly on the chart.
The indicator tracks both **Major Market Structure** and **Internal Market Structure**, allowing traders to quickly understand the bigger market direction while also identifying shorter-term structural changes.
### Key Features
**Market Structure Detection**
* Identifies bullish and bearish structure breaks.
* Major structure is displayed as **BREAKOUT**.
* Internal structure is displayed as **BREAKOUT 2**.
* Tracks both **Change of Character (CHoCH)** and **Break of Structure (BoS)**.
**Automatic BUY & SELL Setups**
KAI LINES can generate trading setups when a market structure shift occurs.
Users can choose between:
* **CHoCH Only** — focuses on potential reversal setups.
* **CHoCH + BoS** — includes both reversal and continuation setups.
**Automatic Trade Plan**
Whenever a valid setup is detected, the indicator automatically calculates and displays:
* BUY or SELL Target Signal
* Primary Entry Area
* Secondary Pullback Entry Area
* Stop Loss Price
* Take Profit 1
* Take Profit 2
* Take Profit 3
* Take Profit 4
Profit targets are calculated using configurable **Risk-to-Reward (R) multiples**, allowing traders to customize their trade management style.
Default targets:
* TP1 = 1R
* TP2 = 2R
* TP3 = 3R
* TP4 = 4R
**Dynamic Stop Loss**
Stop Loss can be calculated using:
* ATR-based volatility
* Previous market structure / swing level
ATR length, ATR multiplier, additional SL buffer, and entry pullback depth can all be customized.
**External & Internal Trend Panel**
A simple trend dashboard displays the current condition of:
* External / Major Structure
* Internal / Minor Structure
This makes it easier to see whether both structures are aligned bullish, bearish, or conflicting.
**TradingView Alerts**
KAI LINES supports BUY and SELL alerts when a new setup is generated, making it possible to monitor multiple markets without constantly watching the chart.
### How to Read KAI LINES
**Bullish Setup**
A bullish structure shift can generate a BUY signal.
The indicator will automatically display:
Entry Area → Stop Loss → TP1 → TP2 → TP3 → TP4.
**Bearish Setup**
A bearish structure shift can generate a SELL signal.
The same trade-plan structure is automatically calculated in the opposite direction.
For higher-quality setups, traders can combine KAI LINES with market context such as trend direction, liquidity, support/resistance, higher-timeframe structure, volume, or fundamental catalysts.
### Important
KAI LINES is a technical analysis and trade-planning tool — it does not guarantee profitable trades.
Signals are evaluated on the **live candle and may change before the candle closes**. For more reliable confirmation, traders should evaluate signals after the candle has closed.
Always use proper risk management.
**KAI LINES — Structure. Entry. Risk. Target.**
KAI LINES is an all-in-one market structure and trade planning indicator designed to help traders identify potential trend shifts, continuation moves, entry areas, stop-loss levels, and profit targets directly on the chart.
The indicator tracks both **Major Market Structure** and **Internal Market Structure**, allowing traders to quickly understand the bigger market direction while also identifying shorter-term structural changes.
### Key Features
**Market Structure Detection**
* Identifies bullish and bearish structure breaks.
* Major structure is displayed as **BREAKOUT**.
* Internal structure is displayed as **BREAKOUT 2**.
* Tracks both **Change of Character (CHoCH)** and **Break of Structure (BoS)**.
**Automatic BUY & SELL Setups**
KAI LINES can generate trading setups when a market structure shift occurs.
Users can choose between:
* **CHoCH Only** — focuses on potential reversal setups.
* **CHoCH + BoS** — includes both reversal and continuation setups.
**Automatic Trade Plan**
Whenever a valid setup is detected, the indicator automatically calculates and displays:
* BUY or SELL Target Signal
* Primary Entry Area
* Secondary Pullback Entry Area
* Stop Loss Price
* Take Profit 1
* Take Profit 2
* Take Profit 3
* Take Profit 4
Profit targets are calculated using configurable **Risk-to-Reward (R) multiples**, allowing traders to customize their trade management style.
Default targets:
* TP1 = 1R
* TP2 = 2R
* TP3 = 3R
* TP4 = 4R
**Dynamic Stop Loss**
Stop Loss can be calculated using:
* ATR-based volatility
* Previous market structure / swing level
ATR length, ATR multiplier, additional SL buffer, and entry pullback depth can all be customized.
**External & Internal Trend Panel**
A simple trend dashboard displays the current condition of:
* External / Major Structure
* Internal / Minor Structure
This makes it easier to see whether both structures are aligned bullish, bearish, or conflicting.
**TradingView Alerts**
KAI LINES supports BUY and SELL alerts when a new setup is generated, making it possible to monitor multiple markets without constantly watching the chart.
### How to Read KAI LINES
**Bullish Setup**
A bullish structure shift can generate a BUY signal.
The indicator will automatically display:
Entry Area → Stop Loss → TP1 → TP2 → TP3 → TP4.
**Bearish Setup**
A bearish structure shift can generate a SELL signal.
The same trade-plan structure is automatically calculated in the opposite direction.
For higher-quality setups, traders can combine KAI LINES with market context such as trend direction, liquidity, support/resistance, higher-timeframe structure, volume, or fundamental catalysts.
### Important
KAI LINES is a technical analysis and trade-planning tool — it does not guarantee profitable trades.
Signals are evaluated on the **live candle and may change before the candle closes**. For more reliable confirmation, traders should evaluate signals after the candle has closed.
Always use proper risk management.
**KAI LINES — Structure. Entry. Risk. Target.**
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。