GoldLab Fibo Pullback is an Expert Advisor that trades Fibonacci retracements of the most recent impulse move. It was designed for XAUUSD (Gold) and also runs on forex pairs and other CFDs. All swing detection is done inside the EA - no external indicators are needed. Every trade has a stop-loss.
How it trades
- Swing detection: swing highs and lows are found in code (a bar that is the highest/lowest of N bars on each side, default 5). The most recent completed swing pair defines the impulse leg.
- Impulse filter: the leg must be at least a minimum size in ATR (default 2.0 x ATR), its extreme must not have been exceeded since, and the setup expires a set number of bars after the swing extreme.
- Entry zone: price retraces into the 50% - 61.8% zone of the impulse.
- Confirmation: a closed candle in the trend direction (bullish for an up impulse, bearish for a down impulse) that closes back on the trend side of the 61.8% level.
- Stop-loss: beyond the 78.6% retracement plus a small ATR buffer. If price trades through 78.6% before entry the setup is cancelled.
- Take-profit: the 127.2% extension of the swing (default), the 161.8% extension, or a retest of the swing extreme. Optional break-even when the trade has covered part of the way to target.
- Only one trade per swing; optional EMA trend filter.
Risk management
- Risk % per trade (default 1% of equity) - the lot is calculated from the actual stop distance. A fixed lot can be used instead.
- Daily loss limit (default 3% of the day-start equity).
- Maximum spread filter and optional trading hours.
- Free-margin check, broker volume limits and stop/freeze levels are respected before every order. One position at a time; works on hedging and netting accounts.
Inputs and default settings
| Group | Input | Default | Meaning |
|---|---|---|---|
| Swing | Signal timeframe | H1 | Timeframe for swing detection (chart timeframe can be anything) |
| Swing | Swing depth (bars each side) | 5 | Swing point sensitivity |
| Swing | Lookback (bars) | 200 | Search range |
| Swing | Min impulse (x ATR) | 2.0 | Ignore small swings |
| Swing | Setup expiry (bars) | 40 | Bars allowed after the swing extreme |
| Entry | Zone start / end % | 50 / 61.8 | Retracement entry zone |
| Entry | Stop level % / Stop buffer (x ATR) | 78.6 / 0.2 | Stop placement |
| Entry | Target | 127.2% | 127.2%, 161.8% or 100% |
| Entry | Use trend EMA / EMA period | false / 100 | Optional trend filter |
| Entry | Break-even at % of target | 50 | 0 = off |
| Position size | Risk % / Fixed lot / Max lot | 1.0 / 0 / 10 | Position sizing |
| Safety | Daily loss limit % | 3.0 | 0 = off |
| Safety | Max spread (points) | 50 | 2-digit gold scale: 100 = 1.00 USD |
| Safety | Use hours / Start / End | false / 1 / 22 | Optional server-time window |
| Safety | Magic number | 26101001 | Change it to run several copies on one symbol |
Recommended setup
- Symbol: XAUUSD (or your broker's gold symbol). Signal timeframe: M30, H1 or H4.
- Hedging or netting accounts; low-spread accounts preferred for gold.
- Start on a demo account with the default 1% risk and test the settings in the Strategy Tester with your broker's data first. A VPS is recommended for 24/5 operation.
Honest notes
No martingale, no grid, no averaging - every position has a stop-loss. Retracements sometimes turn into full reversals, and the EA waits for clean swings, so it may trade only a few times per week. Trading gold, forex and CFDs is high risk and you can lose your capital. No trading system wins every trade, and past or backtested results do not guarantee future results. Only trade money you can afford to lose and always test on a demo account first.


Plan your risk before you run it
- Check the lot the EA will use for your balance and stop with the XAUUSD lot size calculator and the margin calculator.
- Compare targets and stops with the risk reward calculator.
- How to Set a Stop Loss on Gold (ATR Method)
- Risk Per Trade: the 1% Rule with Gold Examples
FAQ
Do I need to draw Fibonacci levels myself?
No. The EA detects swing highs and lows in code, measures the impulse leg and calculates the retracement and extension levels on its own.
Is there a free demo?
Yes. Every MQL5 Market product has a free demo that runs in the MetaTrader 5 Strategy Tester, so you can test it on your broker's own data before buying.
Does it use martingale, grid or averaging down?
No. Every position is opened with a stop-loss, the lot size comes from your risk % (or a fixed lot), and there is a daily loss limit.
Which broker and account do I need?
Any MetaTrader 5 broker that offers XAUUSD, on a hedging or netting account. A low-spread account and a VPS for 24/5 operation are recommended.
Can this EA guarantee profits?
No. No trading system wins every trade, and backtest or past results do not guarantee future results. Start on a demo account with the default risk.
Trading gold, forex and CFDs is high risk and you can lose your capital. This page is for information only and is not investment advice. Illustrations are not trading results.
