OPEN-SOURCE SCRIPT
업데이트됨 Inverse Fair Value Gaps (Wicks) v6 — Sticky

This indicator marks iVFG and FVG for all the trading you need
릴리즈 노트
UPDATED: This now shows proper FVG Bullish & Bearish + IVFG 릴리즈 노트
# **Wick-Based FVG + IFVG Script – User Guide**## **Overview**
This script identifies **Fair Value Gaps (FVGs)** and **Inverse FVGs (IFVGs)** using **wicks (high/low)** rather than candle bodies. It helps traders identify price gaps that could act as potential support/resistance or trigger reversals.
* **FVGs**: Unfilled gaps in price caused by rapid price movement.
* **IFVGs**: Occur when price breaks beyond a previous FVG, signaling potential continuation or reversal.
---
## **Inputs**
| Setting | Description |
| ----------------- | ------------------------------------------------------------ |
| Show FVGs | Toggle to display bullish and bearish FVGs. |
| Show IFVGs | Toggle to display inverse FVGs when price breaks past FVGs. |
| Border Width | Width of the boxes drawn on the chart. |
| Bullish FVG Color | Color of bullish FVG boxes. |
| Bearish FVG Color | Color of bearish FVG boxes. |
| Bull IFVG Color | Color of bullish IFVG boxes (when price breaks bearish FVG). |
| Bear IFVG Color | Color of bearish IFVG boxes (when price breaks bullish FVG). |
---
## **How It Works**
### **1. Detecting FVGs**
* **Bullish FVG** (Gap Down)
* Detected when: `high[2] < low`
* Box drawn from **top = high[2]** to **bottom = low**
* **Bearish FVG** (Gap Up)
* Detected when: `low[2] > high`
* Box drawn from **top = low[2]** to **bottom = high**
> Boxes are drawn using **wick extremes**, not candle bodies.
---
### **2. Detecting IFVGs**
* **Bullish IFVG**
* Triggered when price breaks **below a previous bullish FVG**.
* Box drawn covering the FVG zone to show price reversal area.
* **Bearish IFVG**
* Triggered when price breaks **above a previous bearish FVG**.
* Box drawn covering the FVG zone to highlight potential reversal.
---
### **3. Labels**
* Each FVG or IFVG has a label:
* `"FVG"` for regular FVGs
* `"Bullish IFVG"` / `"Bearish IFVG"` for inverse FVGs
* Labels are placed in the **middle of the box** for visibility.
---
## **Usage Instructions**
1. **Add Script to Chart**
* Copy the full script into TradingView Pine Editor.
* Set version to **v6** at the top: `//version=6`
* Click **Add to Chart**.
2. **Configure Inputs**
* Open the **Settings** panel for the script.
* Toggle colors, border width, and whether FVGs/IFVGs are displayed.
3. **Interpret the Boxes**
* **Green box** → Bullish FVG (gap down)
* **Red box** → Bearish FVG (gap up)
* **Teal box** → Bullish IFVG (price breaks bearish FVG)
* **Orange box** → Bearish IFVG (price breaks bullish FVG)
4. **Trade Signals (Optional)**
* **Bullish FVG**: Potential long zone if price returns to gap.
* **Bearish FVG**: Potential short zone if price returns to gap.
* **IFVGs**: Signal momentum continuation in the direction of the break.
---
## **Tips**
* Use in combination with **price action** or **trend analysis** for better signals.
* FVGs are more reliable in **high volatility zones** (e.g., after news or breakouts).
* Adjust **colors** for visibility against your chart background.
* **Sticky FVGs**: Once drawn, FVG boxes remain until completely filled.
---
## **Troubleshooting**
* **Error: `end of line without line continuation`**
* Use **single-line `box.new()`** calls instead of multi-line.
* Example:
```pinescript
b = box.new(left=bar_index-2, top=a_high, right=bar_index, bottom=c_low, bgcolor=bull_fvg_color, border_color=color.new(color.green,0), border_width=border_width)
```
* **Boxes not appearing**
* Ensure **Show FVGs / Show IFVGs** inputs are enabled.
* Script only draws boxes **after bar 2** (needs at least 3 bars).
---
## **Example Chart Layout**
| Box Color | Meaning |
| --------- | ------------ |
| Green | Bullish FVG |
| Red | Bearish FVG |
| Teal | Bullish IFVG |
| Orange | Bearish IFVG |
---
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.