OPEN-SOURCE SCRIPT
ICT by KG

# ICT by KG
### A Complete ICT Structure-Based Entry System
**ICT by KG** is a sophisticated Pine Script indicator that automates core ICT concepts, providing clear entry signals based on market structure, displacement, and premium/discount arrays.
## 🔍 Overview
This indicator combines multiple ICT concepts into one cohesive system:
- Market Structure (Swing Highs/Lows, Break of Structure)
- Displacement Detection (momentum candles with minimal wicks)
- PD Array Tracking (Fair Value Gaps & Order Blocks)
- Kill Zone Filtering (New York session)
- VWAP Integration (directional filter)
## 🎯 Core Logic
Signals are generated ONLY when ALL conditions align:
**LONG Entry:**
- Bullish Break of Structure (BOS) confirmed
- Bullish displacement detected (minimum consecutive bars)
- Price retraces into a bullish FVG or Order Block
- Within an active Kill Zone (optional)
- Price above VWAP (optional)
- CE (50% level) touch required (configurable)
**SHORT Entry:**
- Bearish Break of Structure (BOS) confirmed
- Bearish displacement detected
- Price retraces into a bearish FVG or Order Block
- Within an active Kill Zone (optional)
- Price below VWAP (optional)
- CE (50% level) touch required (configurable)
## ⚙️ Key Features
**Market Structure**
- Customizable swing length (3–20 bars)
- HTF bias timeframe reference
- Automatic BOS labels & background shading
**Displacement**
- ATR-based threshold + wick/body ratio filter
- Configurable minimum consecutive bars
- Highlighted bars for visual confirmation
**PD Arrays (FVG & Order Blocks)**
- FVG boxes appear after BOS
- Order Blocks = last opposite candle before displacement
- CE (50%) level requirement option
- Configurable lookback & display limits
**Kill Zone Filter**
- NY Kill Zone (7–10 AM ET) & NY Afternoon (1–4 PM ET)
- Optional enable/disable
**VWAP Integration**
- Session or Weekly reset
- Directional filter (longs > VWAP / shorts < VWAP)
## 📊 Visual Elements
- Swing Points: "H" (red) & "L" (green) labels
- BOS Labels: "BOS↑" (lime) & "BOS↓" (red)
- Displacement: Highlighted bars
- FVG/OB Boxes: Semi‑transparent green/red
- Entry Signals: "⚡ LONG" (lime) & "⚡ SHORT" (red) labels
- Background Shading: Subtle green/red for structure bias
## 📈 Heads‑Up Display (HUD)
A live info panel shows:
- Kill Zone status
- Market structure bias
- BOS age & status
- Displacement status
- PD Array activity
- VWAP relationship
- Action recommendation
## ⚡ Alerts
Built‑in alerts for:
- LONG Entry signals
- SHORT Entry signals
- Bullish Break of Structure
- Bearish Break of Structure
## 🛠️ Input Parameters
| Group | Parameter | Description |
|--------------------|-------------------------|--------------------------------------|
| Market Structure | Swing Length | Pivot sensitivity (3–20) |
| | HTF Bias Timeframe | Higher timeframe reference |
| | Show Swing Points | Toggle H/L labels |
| Displacement | ATR Multiplier | Displacement threshold (1.0–3.0) |
| | Max Wick/Body Ratio | Rejection filter (0.1–0.5) |
| | Min Displacement Bars | Consecutive bars required (1–5) |
| PD Arrays | Show FVG/OB | Toggle boxes |
| | Max to Track | Number of boxes displayed (3–20) |
| | Order Block Lookback | OB candle position (1–10) |
| | Require CE Tag | Force 50% level touch |
| VWAP | Show VWAP | Toggle VWAP line |
| | VWAP Reset | Session or Week |
| | VWAP Filter | Directional filter |
| Kill Zones | Enable Filter | Toggle time filter |
| | NY Kill Zone | NY session only |
| Colors | Bullish/Bearish Colors | Customize box colors |
## 📝 How to Use
1. Add to chart and adjust inputs as needed.
2. Watch the HUD – all conditions must align.
3. Entry signals appear when price taps into PD arrays.
4. Confirm with higher timeframe bias (optional).
5. Manage risk according to your trading plan.
## ⚠️ Disclaimer
This indicator is for educational and informational purposes only. It is not financial advice. Past performance does not guarantee future results. Always conduct your own analysis and risk management before trading.
---
**Version:** 1.0
**Author:** KG
**Based on:** ICT (Inner Circle Trader) Methodology
### A Complete ICT Structure-Based Entry System
**ICT by KG** is a sophisticated Pine Script indicator that automates core ICT concepts, providing clear entry signals based on market structure, displacement, and premium/discount arrays.
## 🔍 Overview
This indicator combines multiple ICT concepts into one cohesive system:
- Market Structure (Swing Highs/Lows, Break of Structure)
- Displacement Detection (momentum candles with minimal wicks)
- PD Array Tracking (Fair Value Gaps & Order Blocks)
- Kill Zone Filtering (New York session)
- VWAP Integration (directional filter)
## 🎯 Core Logic
Signals are generated ONLY when ALL conditions align:
**LONG Entry:**
- Bullish Break of Structure (BOS) confirmed
- Bullish displacement detected (minimum consecutive bars)
- Price retraces into a bullish FVG or Order Block
- Within an active Kill Zone (optional)
- Price above VWAP (optional)
- CE (50% level) touch required (configurable)
**SHORT Entry:**
- Bearish Break of Structure (BOS) confirmed
- Bearish displacement detected
- Price retraces into a bearish FVG or Order Block
- Within an active Kill Zone (optional)
- Price below VWAP (optional)
- CE (50% level) touch required (configurable)
## ⚙️ Key Features
**Market Structure**
- Customizable swing length (3–20 bars)
- HTF bias timeframe reference
- Automatic BOS labels & background shading
**Displacement**
- ATR-based threshold + wick/body ratio filter
- Configurable minimum consecutive bars
- Highlighted bars for visual confirmation
**PD Arrays (FVG & Order Blocks)**
- FVG boxes appear after BOS
- Order Blocks = last opposite candle before displacement
- CE (50%) level requirement option
- Configurable lookback & display limits
**Kill Zone Filter**
- NY Kill Zone (7–10 AM ET) & NY Afternoon (1–4 PM ET)
- Optional enable/disable
**VWAP Integration**
- Session or Weekly reset
- Directional filter (longs > VWAP / shorts < VWAP)
## 📊 Visual Elements
- Swing Points: "H" (red) & "L" (green) labels
- BOS Labels: "BOS↑" (lime) & "BOS↓" (red)
- Displacement: Highlighted bars
- FVG/OB Boxes: Semi‑transparent green/red
- Entry Signals: "⚡ LONG" (lime) & "⚡ SHORT" (red) labels
- Background Shading: Subtle green/red for structure bias
## 📈 Heads‑Up Display (HUD)
A live info panel shows:
- Kill Zone status
- Market structure bias
- BOS age & status
- Displacement status
- PD Array activity
- VWAP relationship
- Action recommendation
## ⚡ Alerts
Built‑in alerts for:
- LONG Entry signals
- SHORT Entry signals
- Bullish Break of Structure
- Bearish Break of Structure
## 🛠️ Input Parameters
| Group | Parameter | Description |
|--------------------|-------------------------|--------------------------------------|
| Market Structure | Swing Length | Pivot sensitivity (3–20) |
| | HTF Bias Timeframe | Higher timeframe reference |
| | Show Swing Points | Toggle H/L labels |
| Displacement | ATR Multiplier | Displacement threshold (1.0–3.0) |
| | Max Wick/Body Ratio | Rejection filter (0.1–0.5) |
| | Min Displacement Bars | Consecutive bars required (1–5) |
| PD Arrays | Show FVG/OB | Toggle boxes |
| | Max to Track | Number of boxes displayed (3–20) |
| | Order Block Lookback | OB candle position (1–10) |
| | Require CE Tag | Force 50% level touch |
| VWAP | Show VWAP | Toggle VWAP line |
| | VWAP Reset | Session or Week |
| | VWAP Filter | Directional filter |
| Kill Zones | Enable Filter | Toggle time filter |
| | NY Kill Zone | NY session only |
| Colors | Bullish/Bearish Colors | Customize box colors |
## 📝 How to Use
1. Add to chart and adjust inputs as needed.
2. Watch the HUD – all conditions must align.
3. Entry signals appear when price taps into PD arrays.
4. Confirm with higher timeframe bias (optional).
5. Manage risk according to your trading plan.
## ⚠️ Disclaimer
This indicator is for educational and informational purposes only. It is not financial advice. Past performance does not guarantee future results. Always conduct your own analysis and risk management before trading.
---
**Version:** 1.0
**Author:** KG
**Based on:** ICT (Inner Circle Trader) Methodology
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.