Fair Value Gaps: Identifying and Tracking Imbalances with Alerts
Info
The Fair Value Gaps: Identifying and Tracking Imbalances with Alerts is a Indicator for MetaTrader 5 that a fair value gap (fvg), also known as an imbalance, is a pattern formed by three candles where the price moved rapidly, causing the wicks of the first and third candles to not overlap. A bullish FVG occurs when the low of the third candle is higher than the high of the first candle.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Indicator works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Indicators folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Fair Value Gaps: Identifying and Tracking Imbalances with Alerts
1. Installation: Place your file in the MQL/Indicators folder via "Open Data Folder" and restart your terminal.
2. Loading: Find the indicator in the Navigator, drag it onto your chart, and configure the input parameters in the popup window.
3. Customization: Press Ctrl+I to open the indicator list, select your tool, and click "Properties" to change colors, levels, or visual styles.
4. Updating: Replace the old file in the Indicators folder with the new version and restart the platform to apply changes.
Frequently Asked Questions
Q: Why is my indicator not showing? A: Verify the file is in the MQL/Indicators folder, or try right-clicking the "Indicators" tree in the Navigator and clicking "Refresh."
Q: Do custom indicators slow down the platform? A: Too many complex indicators can impact performance; remove unused ones via the "Indicator List" (Ctrl+I).
Q: Can I use MT4 indicators on MT5? A: No, MQL4 and MQL5 are distinct languages; ensure the indicator is compiled specifically for your platform version.
What this tool does
A Fair Value Gap (FVG), also known as an imbalance, is a pattern formed by three candles where the price moved rapidly, causing the wicks of the first and third candles to not overlap.
Typical Use Case
This Indicator excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Indicator works on MetaTrader 5. Place the file in the MQL5/Indicators folder and restart the terminal.
Description & Settings
Related: Non-Repainting Fair Value Gap Detector for MT5 - another powerful indicator for MetaTrader 5 traders.
A Fair Value Gap (FVG), also known as an imbalance, is a pattern formed by three candles where the price moved rapidly, causing the wicks of the first and third candles to not overlap.Also recommended: Inversion Fair Value Gaps Indicator with Bounce Signals - similar indicator with strong performance on MetaTrader 5.
A bullish FVG occurs when the low of the third candle is higher than the high of the first candle.
A bearish FVG occurs when the high of the third candle is lower than the low of the first candle.
Price frequently revisits these gaps. This indicator highlights the currently open gaps, providing a clear visual of these zones.
Indicator Features
Displays all open gaps as colored boxes, green for bullish and red for bearish, extending from the second candle to the right.
Marks the 50% level of each gap, often referred to as the consequent encroachment level.
Tracks the percentage of each gap that has been filled. When a gap is considered filled (default 100%, or a user-defined percentage), its box is drawn up to the candle that completed the fill.
Optionally displays filled gaps as grey boxes to illustrate price reactions in these areas.
Operational Details
Gaps are identified based on closed candles only, ensuring that gaps do not appear or disappear after formation (no repainting).
Filters out small gaps based on a minimum size defined as a multiple of ATR(14) (default 0.25x ATR) or a fixed point value.
To maintain chart clarity, only the most recent open gaps are displayed (default 10 per direction).
The calculation process is incremental, with only the new candle being processed after the initial scan.
User-Configurable Inputs
Bars to analyze (default 1500)
Minimum gap size: specified as a multiplier of ATR(14) or in points.
Percentage fill threshold to consider a gap filled (default 100%)
Number of unfilled gaps to display per direction; option to retain filled gaps as boxes; visibility of filled gaps.
Option to draw the 50% level line; customizable color settings.
Alerts: triggers for new gaps and when price re-enters a gap; supports push notifications and email alerts.
Expert Advisor Data Buffers (Accessible via iCustom, not visually drawn)
Buffer 0 / 1: Represents the top / bottom boundary of the most recent unfilled bullish gap.
Buffer 2 / 3: Represents the top / bottom boundary of the most recent unfilled bearish gap.
EMPTY_VALUE is used when no gap is present.
Example Usage: To retrieve the top price of the newest open bullish gap on the last closed candle, use: double top[]; CopyBuffer(handle, 0, 1, 1, top);.
Additional Information
This indicator is compatible with any trading symbol and timeframe.
The indicator is designed solely for visualization and calculation purposes; it does not execute trades.
You may also like: Fair Value Gap Scanner for MT5 - excellent alternative for indicator users on MetaTrader 5.
Source Code
#property copyright "RobotFX"
#property link "https://robotfx.org"
#property version "1.00"
#property description "This code is educational. Feel free to use, modify and upgrade as you wish. Visit ROBOTFX.ORG for professional trading tools"
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_plots 4
#property indicator_type1 DRAW_NONE
#property indicator_label1 "Bullish FVG top"
#property indicator_type2 DRAW_NONE
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.