GoldSwallower MT5 Source Code (Authentic)
Pinned Annual
Featured
MT5v6.1
GoldSwallower is a fully automated MT4/MT5 quantitative trading EA built for XAUUSD (London Gold). It fuses range-grid harvesting with trend-following swing capture, avoiding the weaknesses of blind martingale averaging and blind trend-chasing. Features multi-indicator filtering, ATR dynamic layered averaging, multi-dimensional exits and a multi-level circuit-breaker risk system. Two mainstream versions: trend-following stable and two-way grid hedge.
Details & Usage Instructions
The strategy is sourced from the internet; trade at your own risk.
Test and optimize on your own.
I. Basic Adaptation Parameters
1. Exclusive instrument: Only adapted for XAUUSD (London Gold); all parameters are deeply optimized on ten years of gold history. Not recommended for major forex pairs.
2. Trading periods: Core period M15; the simplified trend version also supports H1.
3. Account capital: Small accounts can start from just $100; accounts above $3,000 can switch to conservative presets. 22 tiered capital presets built in — one-click switch, no manual tuning.
4. Order modes: Three directions freely switchable — long-only, short-only, two-way grid trading.
II. Core Opening & Averaging Logic (EMA + RSI + ATR Triple Filter)
Abandons indiscriminate frequent orders; relies on multi-indicator confluence to select high-value opportunities, cutting spread and commission cost:
1. First-order entry
Uses EMA to judge the price range, with a secondary RSI overbought/oversold filter; the first order triggers only when price deviates from the EMA band and the move shows a clear momentum high/low. When EMAs tangle and price chops, opening auto-pauses to reduce wasted cost.
2. Adaptive layered averaging
Unlike fixed-ratio martingale, uses ATR volatility to dynamically adjust averaging spacing: widens in violent moves, narrows in tight ranges. First lot, averaging multiplier, max averaging count and fixed lot are all customizable; one-click switch between aggressive and stable modes.
3. Trend identification
Multi-period confluence judges the overall trend: the trend version only opens/averages along the main trend, never counter-trend; the two-way grid version deploys both sides in ranges and auto-reduces reverse order frequency in one-sided trends.
III. Six Exit Mechanisms
Combines multiple exits covering partial profit-taking, profit protection and forced risk-stop:
1. Basket average take-profit
All same-direction orders merged into an average cost; once target profit points are reached, the whole basket closes together — no manual splitting.
2. Full-position cap take-profit
After averaging reaches the preset max count, if the basket's total profit hits target, close all at once to avoid risk from long full positions.
3. Account-wide total profit close
When all positions' combined profit reaches a set amount, all orders auto-close, completing one full trading cycle.
4. Global floating-loss forced stop
When overall floating loss exceeds a preset equity ratio (5%/8% etc., customizable), the system force-closes all positions, halting further loss.
5. High/low order hedge reduction
When many same-direction positions accumulate, auto-closes the highest- and lowest-priced orders to free margin and ease long-order stacking.
6. ATR dynamic trailing stop
After profit breaks the activation level, a trailing stop activates, dynamically adjusting stop distance by real-time volatility, locking in paper profits and avoiding giveback or reversal to loss.
IV. Multi-level Circuit-Breaker Risk System (Core Advantage)
A dedicated risk module for extreme gold events (NFP, FOMC), with multi-layer protection to lower blow-up probability:
1. Monitors spread and single-candle volatility in real time; stops new orders beyond threshold.
2. Customizable trading windows and averaging-pause windows; auto-halt around major data releases.
3. Timed one-click close-all to proactively avoid risk-concentrated sessions.
4. Caps max one-sided long/short order count; blocks new opens beyond limit.
5. When equity shrinks to a set % of balance, triggers circuit-breaker lock and stops all opening.
6. Dedicated total floating-loss breaker: when floating loss hits the cap, not only stops opening but also auto-launches hedge reduction to protect the account.
V. Two Versions — Key Differences
1. Trend GoldSwallower (Stable / Beginner)
• Logic: Only opens along the main trend, no reverse grid, no counter-trend holding.
• Advantage: Win rate above 85%, fewer orders, lower drawdown — suited to beginners and small accounts.
• Weakness: In prolonged tight ranging, lower frequency and slower capital growth.
2. Two-way Grid GoldSwallower (Balanced / Mainstream)
• Logic: Deploys both sides in ranges for two-way arbitrage; auto-reduces reverse opening in one-sided moves.
• Advantage: Perfect for gold's frequent ranging; smooth equity curve, higher efficiency; most backtests are based on this version.
• Weakness: In sustained no-pullback extreme trends with aggressive params, staged floating-loss drawdown occurs; better for mid/large accounts.
VI. Product Core Advantages
1. Gold-exclusive tuning: averaging spacing, TP/SL and indicator filters are all calibrated on gold's historical volatility — far better fit than generic forex EAs.
2. Avoids martingale flaws: multi-indicator filtering cuts counter-trend averaging; combined with multi-level forced stops, greatly lowers blow-up risk.
3. Highly free parameters: lot, averaging multiplier, TP/SL and risk thresholds all customizable — fits small and large accounts.
4. All-market adaptation: grids accumulate steady profit in ranges; trend-following captures big swings in one-sided moves.
5. Visual panel: shows daily P/L, total positions, max floating loss, cumulative trades, plus full statistics — clear and intuitive.
VII. Potential Risks & Limitations
1. Extreme one-sided drawdown: In moves >$30/day with no pullback, the two-way grid can show large floating loss; final result depends entirely on how conservative the risk params are.
2. Historical overfitting: Several preset param sets are optimized on past data; some aggressive presets only fit past regimes and degrade if market structure shifts.
3. Trading environment matters: Stable low-latency VPS and low-spread/low-commission gold accounts are the foundation of steady profit; high slippage and fees erode returns.
4. Cannot run loss-free: The EA is only a programmatic aid; paired with high multipliers and no-risk-control small-account naked running, blow-up risk remains — never use it outside risk rules.
VIII. Who It's For
1. Trades gold mainly, lacks time to watch screens, needs a fully automated tool.
2. Prefers range arbitrage, can accept short-term small drawdowns, seeks long-term steady compounding.
3. Not good at manual param tuning, needs built-in presets and a low learning curve.
4. Can run a stable VPS, holds a low-spread gold account, and strictly follows risk rules.



Risk Warning:Resources on this site are for learning, research and technical exchange only, and do not constitute any investment advice. Before running any EA on any account, please do thorough forward-testing on a demo account first; no strategy can guarantee profits.