Skip to content
FXNook HubBeta

Alex / Fair Value Gap (FVG) Indicator for MT5

MetaTrader 5IndicatorMITCompiled · build 6333
Compile logCompiled
MetaEditor build 6333 · MT5 · 1 Dec 2026, 10:20 UTCcompiling FXN_FairValueGap.mq5✓ Result: 0 errors, 0 warnings, 3.7 soutput FXN_FairValueGap.ex5 · 26 KBsha256 f3bab626dc1cb2ca…5ca9f166

Files version 1.0

FileLinesSize
FXN_FairValueGap.mq532211 KB
FXN_FairValueGap.ex5 compiled by the Lab–26 KB
FXN_FairValueGap.mq5322 lines
//+------------------------------------------------------------------+//| FXN_FairValueGap.mq5                                             |//| FXNook Lab Hub starter library - MIT licence                     |//| https://lab.fxnook.com/hub                                       |//+------------------------------------------------------------------+#property copyright "FXNook Lab (MIT licence)"#property link      "https://lab.fxnook.com/hub"#property version   "1.00"#property description "Marks 3-candle fair value gaps (imbalances) as boxes that extend right until price fills them."#property indicator_chart_window#property indicator_buffers 4#property indicator_plots   4#property indicator_label1  "Bullish FVG top"#property indicator_type1   DRAW_NONE#property indicator_label2  "Bullish FVG bottom"#property indicator_type2   DRAW_NONE#property indicator_label3  "Bearish FVG top"#property indicator_type3   DRAW_NONE#property indicator_label4  "Bearish FVG bottom"#property indicator_type4   DRAW_NONE#define PFX "FXN_FVG_"enum ENUM_FVG_FILL{   FVG_FILL_TOUCH = 0,   // Price touches the gap   FVG_FILL_HALF  = 1,   // Price reaches the middle of the gap   FVG_FILL_FULL  = 2    // Price trades through the whole gap};//--- inputsinput group "Detection"input int           InpMinGapPoints = 0;               // Minimum gap size in points (0 = off)input double        InpMinGapAtr    = 0.10;            // Minimum gap size as a fraction of average range (0 = off)input int           InpAtrPeriod    = 14;              // Bars used for the average rangeinput int           InpMaxBars      = 1500;            // History bars to scan (0 = all bars)input int           InpMaxZones     = 40;              // Maximum boxes kept on the chart (oldest removed first)input ENUM_FVG_FILL InpFillMode     = FVG_FILL_FULL;   // When a gap counts as filled
Sign in to read all the code and download it

It is free. A free account lets you see every line, copy it, download the source and open a copy in your Lab. The compiled file can be downloaded without an account.

Sign in Create a free account

Version history

  1. Version 1.0Live1 Dec 2026

    First version.

    Source · Compiled