Fibo FVG EA
- Experts
-
Rikza Fauzan Nurfadilah
Rikza Fauzan Nurfadilah | Algorithmic Trading Developer for MetaTrader 5
I develop Expert Advisors and custom indicators for MetaTrader 5, focused on structured, rule-based strategies with clear entry logic, controlled risk, and transparent behavior.
My current portfolio includes: - Version: 1.0
- Activations: 5
FVG Fib EA: Fair Value Gap Retests in Higher-Timeframe Fibonacci Zones
Automated Smart-Money style trading for MetaTrader 5, built on structure, not noise.
Overview
FVG Fib EA trades retests of Fair Value Gaps (FVG) that form inside the buy or sell zone of a higher-timeframe swing leg. It first reads the market structure on a higher timeframe, measures the Fibonacci retracement of the latest confirmed leg, and only then looks for a three-candle imbalance on the chart timeframe that price returns to in the right zone. The entry is taken on the first valid reaction to that gap, with a defined stop loss beyond the gap and a take profit at the nearest higher-timeframe swing or at a fixed risk-reward ratio.
Every rule is objective and measurable. The EA does not use martingale, grid, averaging, or any form of position doubling.
Key Features
- Automatic higher-timeframe selection: M5 uses M30, M15 uses H1, H1 and M30 use H4, H4 uses D1, and D1 uses W1. Manual selection is also available.
- Swing structure detection: confirmed swing highs and lows on the higher timeframe, with no look-ahead bias. A swing is only used after its confirmation bars have closed.
- Fibonacci zone filter: trades only when the gap overlaps the configurable retracement zone (default 50% to 78.6%) of the latest leg.
- Fair Value Gap detection: three-candle imbalances on the chart timeframe, filtered by minimum size relative to ATR.
- First-touch entry logic: the gap must be touched for the first time, the reaction candle must close in the trade direction, and the close must hold beyond the gap.
- Risk-based SL and TP: stop loss beyond the gap with an ATR buffer, and a take profit at the higher-timeframe swing extreme when it is at least 1R away, otherwise a fixed risk-reward target.
- Position sizing: fixed lot or percentage-of-balance risk. Lot size is never rounded up to the broker minimum, so the risk limit is respected.
- Safety filters: maximum SL distance (ATR multiple), maximum spread, margin usage cap, and one position per magic number.
- Break-even management: stop loss moves to entry once price reaches a configurable R multiple.
- Visual analysis on chart: all FVG zones (active and mitigated), Fibonacci levels with price labels, shaded buy or sell zone, historical signals with SL and TP zones, and a live dashboard showing HTF leg, retracement, zone status, open position, and floating P/L.
- Alerts: popup, push notification, sound, and email (all optional).
How It Works
- On each new closed bar, the EA updates the higher-timeframe swing structure and identifies the latest confirmed leg.
- It calculates the Fibonacci zone of that leg. A bullish leg produces a buy zone below the swing high. A bearish leg produces a sell zone above the swing low.
- It scans recent chart bars for FVGs that overlap the zone and match the trend direction.
- When price first touches an eligible gap and the reaction candle closes in the trade direction, the EA opens one market order with SL and TP.
- Break-even is applied automatically if enabled. The dashboard tracks the trade in real time.
Recommended Usage
Symbols
- Primary: XAUUSD (Gold), EURUSD, GBPUSD, USDJPY
- Works on any liquid instrument with clean swing structure
- Avoid thinly traded symbols and instruments with frequent gaps at session opens
Timeframes (chart / higher timeframe)
- M5 / M30 and M15 / H1 for intraday trading
- H1 / H4 for swing-oriented trading with fewer, higher-quality signals
- M1 and M5 charts need a stable, low-spread broker because gaps are small
Broker and Account
- Low spread, fast execution, and no requoting on your chosen symbol
- Hedging or netting accounts are both supported
- A VPS close to the broker’s server is recommended for consistent execution
Trading Hours
- Gap formation is strongest during London and New York sessions. Use the spread filter or your own session rules to avoid thin periods.
Recommended Minimum Equity
These figures are guidance only. Replace them with the results of your own Strategy Tester runs before publishing.
| Account Size | Lot Mode | Suitable For |
|---|---|---|
| 300 USD | Fixed 0.01 | Testing and demo validation |
| 500 USD | Fixed 0.01 | Cautious live use on a low-spread account |
| 1,000 USD or more | Risk 1% per trade | Standard live use with dynamic sizing |
Important: on small accounts, the calculated lot in risk-percent mode may fall below the broker’s minimum. In that case the EA skips the trade rather than increasing risk. Check the Journal for “Lot below broker minimum” messages during testing. Gold has large point values, so confirm contract size and tick value before enabling risk-percent mode.
Requirements
- MetaTrader 5, build 1800 or later
- Algo Trading enabled in the terminal
- The chart timeframe must be lower than the higher timeframe used (M1 to H4 are supported with automatic selection)
- At least 300 bars of history on both the chart and higher timeframe
Input Summary
| Group | Main Inputs | Purpose |
|---|---|---|
| Money Management | Fixed lot, risk %, max margin %, max spread, magic number | Position sizing and safety |
| Higher Timeframe | Auto HTF, manual HTF, swing bars, HTF bars | Structure detection |
| Fibonacci Zone | Zone start and end | Retracement filter |
| Fair Value Gap | ATR period, minimum gap size, lookback | Gap detection |
| Signal Logic | Trend, zone, candle filters, SL buffer, max SL, R:R | Entry rules |
| Trade Management | Break-even R, close opposite | Position handling |
| Visual | Toggles for FVG, Fib, SL/TP, history, dashboard, theme | Chart display |
| Alerts | Popup, push, sound, email | Notifications |
Support
Questions about installation, settings, or compatibility can be sent through the MQL5 messaging system. Include your broker name, symbol, timeframe, and the relevant Journal lines.
Risk Disclosure
Trading leveraged financial instruments involves significant risk of loss and may not be suitable for all investors. Past performance, including backtest and optimization results, does not guarantee future results. This product is a trading tool and does not guarantee profit. Only trade with capital you can afford to lose, and test on a demo account before using real funds.
