OPEN-SOURCE SCRIPT
Michael's FVG Detector

═══════════════════════════════════════
Michael's FVG Detector
═══════════════════════════════════════
A clean and efficient Fair Value Gap (FVG) indicator for TradingView that helps traders identify market imbalances with precision.
───────────────────────────────────────
Overview
───────────────────────────────────────
Fair Value Gaps (FVGs) are price inefficiencies that occur when there's a gap between the wicks of candlesticks, indicating rapid price movement with minimal trading activity. These gaps often act as support/resistance zones where price may return to "fill the gap."
This indicator automatically detects and visualizes both bullish and bearish FVGs on any timeframe, making it easy to spot potential trading opportunities.
───────────────────────────────────────
Features
───────────────────────────────────────
Core Functionality
Customization
Performance Optimization
───────────────────────────────────────
How It Works
───────────────────────────────────────
Detection Logic
Bullish FVG:
Bearish FVG:
Visual Display
Each detected FVG is displayed as:
───────────────────────────────────────
Performance Notes
───────────────────────────────────────
───────────────────────────────────────
Disclaimer
───────────────────────────────────────
This indicator is for educational and informational purposes only. It is not financial advice. Always do your own research and risk management before making trading decisions.
───────────────────────────────────────
Author: Michael
Version: 1.0
License: Free for personal use
Last Updated: November 2025
Michael's FVG Detector
═══════════════════════════════════════
A clean and efficient Fair Value Gap (FVG) indicator for TradingView that helps traders identify market imbalances with precision.
───────────────────────────────────────
Overview
───────────────────────────────────────
Fair Value Gaps (FVGs) are price inefficiencies that occur when there's a gap between the wicks of candlesticks, indicating rapid price movement with minimal trading activity. These gaps often act as support/resistance zones where price may return to "fill the gap."
This indicator automatically detects and visualizes both bullish and bearish FVGs on any timeframe, making it easy to spot potential trading opportunities.
───────────────────────────────────────
Features
───────────────────────────────────────
Core Functionality
- Automatic FVG Detection: Identifies Fair Value Gaps in real-time as they form
- Bullish & Bearish FVGs: Detects both upward and downward price gaps
- 3-Candle Pattern: Uses classic FVG logic (current candle low > high from 2 bars ago for bullish, vice versa for bearish)
- Gap Size Display: Shows the exact size of each FVG in ticks directly on the box
- Confirmed Bars Only: Only draws FVGs on confirmed bars to prevent repainting
Customization
- Color Settings: Fully customizable colors for bullish and bearish FVGs with transparency control
- Text Color: Configurable color for the tick size labels
- Default Styling: Comes with sensible defaults (20% transparency, dark gray labels)
Performance Optimization
- Smart Cleanup: Automatically removes boxes outside the visible chart area
- Efficient Rendering: Maintains optimal performance even on lower timeframes
- No Repainting: Uses confirmed bars only for reliable signals
───────────────────────────────────────
How It Works
───────────────────────────────────────
Detection Logic
Bullish FVG:
- Current bar's low is higher than the high from 2 bars ago
- Creates an upward gap that price left behind during bullish momentum
Bearish FVG:
- Current bar's high is lower than the low from 2 bars ago
- Creates a downward gap that price left behind during bearish momentum
Visual Display
Each detected FVG is displayed as:
- A semi-transparent colored box spanning the gap area
- The box extends from bar -2 to the current bar
- Gap size in ticks shown at the bottom-left of each box
- Singular/plural formatting ("1 tick" vs "X ticks")
───────────────────────────────────────
Performance Notes
───────────────────────────────────────
- Cleanup runs every 50 bars to maintain optimal performance
- Only creates boxes on confirmed bars (no real-time repainting)
- Efficiently manages memory by removing off-screen boxes
- Suitable for both manual and automated trading strategies
───────────────────────────────────────
Disclaimer
───────────────────────────────────────
This indicator is for educational and informational purposes only. It is not financial advice. Always do your own research and risk management before making trading decisions.
───────────────────────────────────────
Author: Michael
Version: 1.0
License: Free for personal use
Last Updated: November 2025
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.