Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy — including backtests — does not guarantee future results. Never trade with money you cannot afford to lose.
What Is This Strategy?
The Swing Level Fvg Confluence strategy is a pure price-action continuation system that combines a Fair Value Gap (FVG) — a three-candle imbalance or "untraded pocket" left behind by an impulsive move — with swing support and resistance levels drawn from confirmed fractal pivots. Its trading style is trend and momentum continuation: it looks for the market to push hard away from a structural floor or ceiling, leave a gap behind, then re-enter on the first retracement back into that gap. Notably, it uses no indicators of any kind — no moving averages, no RSI, no ATR, no Bollinger Bands. Every decision is made from raw candle highs and lows.
The core idea is confluence. On their own, both a fair value gap and a swing level fire too often to be useful — gaps appear constantly, and price brushes past horizontal levels all day. This strategy only acts when the two line up: a bullish gap that launched directly off a swing support level (demand stacked on a structural floor), or a bearish gap that dropped away from a swing resistance level (supply stacked on a structural ceiling). A lone gap or a lone level is ignored. By requiring both footprints to agree, the strategy aims to describe a higher-quality location rather than a single noisy signal.
As a learning tool, this EA is well suited to traders studying modern price-action and "smart money" concepts who want to see how imbalances and market structure can be combined into a single, rule-based system. Because everything is scaled by a plain mean candle range computed from recent bars, the same logic adapts across symbols and volatility levels without needing to know the point size. Think of it as a structured way to study confluence-based entries — not as a profit opportunity.
How It Works
The strategy evaluates the chart once per newly closed bar, harvests fresh swing levels and gaps, and looks for a single high-confluence setup. Here is the logic in plain English:
- Volatility scale: The strategy first averages the candle range (high minus low) over the recent lookback window. This mean range becomes the yardstick for every threshold below, so the rules self-adjust to the symbol and current volatility.
- Swing level harvest: It scans recent closed bars for confirmed fractal pivots. A bar is a swing high (resistance) if its high tops every bar within
PivotLegcandles on both sides, and a swing low (support) if its low bottoms them. Using only closed bars keeps these levels non-repainting. - Gap detection (long): A bullish fair value gap exists when the oldest candle's high sits below the newest candle's low (leaving an untraded pocket) and the impulsive middle candle closed higher than it opened.
- Confluence filter: The strategy signals interest only if a swing support level sits in the base region of that bullish gap. This is what stacks structural demand under the imbalance.
- Freshness check: The gap must be untouched — no earlier candle may have already dipped into it (the strategy wants the first tap), and no candle may have closed below the gap base (which would mean it was already filled or invalidated).
- Entry trigger (long): When the just-closed candle retraces and taps the gap for the first time, and closes back above the gap base (confirming the level held), the strategy signals a buy.
- Stop-loss logic: The stop is placed just below the gap base or the signal candle's low (whichever is lower), minus a small buffer scaled to the mean range. This keeps risk anchored to the level that is supposed to hold.
- Take-profit logic: The target is a genuine structural level — the nearest swing resistance above the entry. If no such level exists, the setup is skipped. The trade is only taken if the resulting reward-to-risk ratio meets the
MinRewardRiskminimum. - Short setups are the exact mirror: a bearish gap dropped off a swing resistance, first retrace taps it, the candle closes back below the base, stop above the base, and the target is the nearest swing support below.
- Trade management: Only one position is held at a time per magic number; the structural stop and target manage the exit. Entries are also skipped whenever the spread is wider than
MaxSpreadPoints.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| Lots | 0.10 | 0.01 | 1.00 | Fixed order volume (lot size) for each trade. |
| PivotLeg | 3 | 2 | 8 | Number of bars required on each side to confirm a fractal swing pivot. Higher values demand more pronounced swings. |
| SrLookback | 60 | 20 | 200 | How many recent closed bars to scan for swing levels and the volatility scale. |
| MinGapFactor | 0.30 | 0.05 | 1.50 | Minimum gap height as a fraction of mean candle range; rejects small noise gaps. |
| ConfluenceFrac | 0.75 | 0.10 | 3.00 | Confluence band — how close (as a fraction of mean range) a swing level must sit to the gap base to count as backing it. |
| ZoneExpiry | 15 | 2 | 40 | Maximum age in bars of a still-unfilled gap before it is treated as stale. |
| StopBufferFrac | 0.25 | 0.00 | 1.00 | Extra stop-loss buffer beyond the gap base or signal-candle extreme, as a fraction of mean range. |
| MinRewardRisk | 1.50 | 0.50 | 5.00 | Minimum reward-to-risk ratio to the structural target; setups below this are skipped. |
| MaxSpreadPoints | 80 | 5 | 300 | Skip entries when the current spread (in points) is wider than this. |
| Magic | 9170 | 0 | 9,999,999 | Magic number used to identify and manage this EA's own positions. |

Recommended Chart Settings
The Swing Level Fvg Confluence strategy was built with EUR/USD or XAU/USD (Gold) on the M15 (15-minute) timeframe in mind, and it is designed to run on whatever symbol and timeframe the chart selects. Because its thresholds are scaled by mean candle range rather than fixed pip values, the logic is intended to translate across any liquid instrument. That said, every market behaves differently, and results will vary considerably across symbols, sessions, and changing market conditions. Always study how the strategy responds on your chosen instrument in a testing environment before drawing any conclusions.
How to Install on MetaTrader 5
- Download the
SwingLevelFvgConfluence.ex5file from the link below. - Copy it to your MT5
MQL5\Expertsfolder. - Restart MetaTrader 5 or refresh the Navigator panel.
- Drag the EA onto a chart matching the recommended symbol and timeframe.
- Configure the input parameters and enable Algo Trading.
What to Consider Before Using This EA
The main strength of this approach is its discipline. By requiring two independent price-action footprints to agree — a fair value gap and a structural swing level — it filters out a large share of the lone signals that would otherwise trigger trades. Anchoring both the stop-loss and the take-profit to real swing structure (rather than an arbitrary pip multiple) keeps the trade idea coherent: you are betting that a specific level holds and that the next structural level is reachable. The freshness and first-tap rules also help avoid entering on gaps that have already been worked through.
There are real limitations to understand. Continuation strategies like this one tend to perform best in trending or impulsive conditions; in choppy, range-bound markets, gaps fill quickly and swing levels break repeatedly, which can produce a string of small losses. Because the EA insists on a structural target with a minimum reward-to-risk ratio, many otherwise-valid setups will simply be skipped — that selectivity can mean long quiet periods. Swing levels are also only confirmed after PivotLeg bars have closed on both sides, so the most recent structure may not yet be recognized. As with any single-position, fixed-lot system, performance depends heavily on parameter choices, spread conditions, and the character of the instrument you run it on. It is a tool for studying confluence logic, not a guarantee of any outcome.
Risk Management Tips
Sound risk management matters far more than any single entry signal. Consider these general principles as part of your education:
- Position sizing: Keep your lot size proportional to your account. A common guideline is to risk no more than 1–2% of account equity per trade, adjusting lots so the distance to your stop reflects that limit.
- Test on a demo account first: Run the EA on a demo or in the Strategy Tester for an extended period before considering any live use, so you understand how it behaves across different conditions.
- Understand drawdown: Even a well-designed strategy will experience losing streaks. Know the maximum drawdown you are emotionally and financially prepared to tolerate.
- Mind costs and spread: Spreads, commissions, and slippage all affect outcomes. The
MaxSpreadPointsfilter helps, but real-world execution can still differ from a backtest. - Never over-leverage: Leverage magnifies losses as much as gains. Only trade with capital you can afford to lose.
Risk Warning
Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.
Downloads
- Expert Advisor: SwingLevelFvgConfluence.ex5 (0 downloads)
- Source Code: SwingLevelFvgConfluence.mq5 (0 downloads)
- Documentation: SwingLevelFvgConfluence.pdf (0 downloads)