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.**
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.