José V. | Debra TradingLab

Simple Fair Value Gap (FVG) Detector

Category: Indicators By: José V. | Debra TradingLab Created: November 10, 2026, 11:00 AM
November 10, 2026, 11:00 AM
Indicators
0 Comments
Simple Fair Value Gap (FVG) Detector

Hello everyone, I want to share a simple but effective code snippet I use to detect Fair Value Gaps (FVG). It highlights both Bullish (green) and Bearish (red) imbalances based on a standard 3-candle pattern. You can easily integrate this logic into your own strategies as a trend or entry filter. Here is the code:

// --- FAIR VALUE GAP (FVG) DETECTION ---

MinGap = 2 * pipsize

// 1. Bullish FVG
BullishFVG = (Low > High[2]) AND (Low - High[2] >= MinGap)

// 2. Bearish FVG
BearishFVG = (High < Low[2]) AND (Low[2] - High >= MinGap)

// --- VISUAL REPRESENTATION ---
IF BullishFVG THEN
DrawRectangle(barindex[2], High[2], barindex, Low) coloured(0,255,0,50) bordercolor(0,255,0,0)
ENDIF

IF BearishFVG THEN
DrawRectangle(barindex[2], Low[2], barindex, High) coloured(255,0,0,50) bordercolor(255,0,0,0)
ENDIF

RETURN

This is the core mathematical logic I use to filter imbalances in my automated systems. If you want to see how I trade these gaps fully automated on Micro Nasdaq (MNQ) and Micro Gold (MGC), you can test my complete strategy free for 30 days here: https://market.prorealcode.com/product/quantra-algorithmic-nasdaq-gold-trend-duo/

Download
Filename: FVG_.itf
Downloads: 6
José V. | Debra TradingLab
José V. | Debra TradingLab Junior
Quant Developer | Creator of Debra TradingLab. Automated trading systems for Micro Nasdaq (MNQ) & Micro Gold (MGC). Try my strategy free for 30 days: https://market.prorealcode.com/product/quantra-algorithmic-nasdaq-gold-trend-duo/
Author’s Profile

Comments

ProRealCode ProRealCode
Loading...