Trading robot · MT5

Gold Sweep EA

by sepehrkafaeinezhad-hue

GoldSweepEA is a MetaTrader 5 expert advisor for XAUUSD.

GitHub stars1
Forks0
Last update4 days ago22 Oct 2026
LicenceNone stated

Overview

On each closed signal bar, default M15, it enters when price sweeps the extreme of a lookback window and closes back inside, optionally requiring a reversal candle. A higher-timeframe fast and slow EMA filter can restrict direction. Stop loss is placed beyond the sweep extreme by an ATR multiple, bounded by point limits, and take profit uses a reward-to-risk ratio. Position size is a risk percent of equity or balance, or a fixed lot. Daily loss, drawdown, open risk, and free-margin checks can halt new trades or close positions. Live trading is off by default, and dry-run mode only logs orders.

Details

Author

sepehrkafaeinezhad-hue on GitHub

Type

Trading robot

Platform

MetaTrader 5 (MQL5)

Strategy

SMC / ICT / price action

Markets

Gold

Timeframes

M15-H1

Risk Profile

No grid, martingale or hedging logic was found in its code or README. That says nothing about how it performs: backtest it first.

Input Parameters

Read from GoldSweepEA.mq5. Defaults are the author's; change them in the EA's Inputs tab.

NameTypeDefaultDescription
InpMagiclong20261022Magic number (unique per chart/symbol)
InpEnableTradingbooltrueMaster switch: allow new entries
InpDryRunboolfalseDry run: log orders, do not send
InpEnableLiveTradingboolfalseAllow trading on REAL accounts
InpPersistStatebooltruePersist state in MQL5/Files
InpResetStateboolfalseIgnore saved state at start (fresh test)
InpLogLevelint2Log level: 0 errors, 1 warn, 2 info, 3 debug
InpAlertsboolfalsePopup alerts on errors/entries (live only)
InpShowDashboardbooltrueShow on-chart dashboard
InpWriteTradeLogbooltrueAppend trade events to CSV in MQL5/Files
InpSignalTFENUM_TIMEFRAMESPERIOD_M15Signal timeframe (closed bars only)
InpSweepLookbackint16Lookback bars for the sweep level (>= 3)
Show all 40 inputs
NameTypeDefaultDescription
InpMinPenetrationATRdouble0.10Min penetration beyond level (x ATR)
InpReclaimBufferATRdouble0.00Close back inside by this buffer (x ATR)
InpRequireReversalClosebooltrueRequire reversal candle (close vs open)
InpMaxBarRangeATRdouble3.00Skip if signal bar range > x ATR (0 = off)
InpAtrPeriodint14ATR period
InpUseTrendFilterbooltrueEnable higher-timeframe EMA filter
InpTrendTFENUM_TIMEFRAMESPERIOD_H1Trend timeframe
InpEmaFastPeriodint50Fast EMA period
InpEmaSlowPeriodint200Slow EMA period
InpTrendRequirePriceboolfalseRequire trend-TF close beyond slow EMA
InpAtrSLMultdouble1.00ATR multiple beyond sweep extreme for SL
InpMinSLPointsint120Minimum SL distance (points)
InpMaxSLPointsint900Maximum SL distance (points, 0 = off)
InpRRdouble2.00Reward:Risk for TP (0 = no TP)
InpRiskBufferPctdouble10.0Inflate risk estimate for costs (%)
InpCommissionPerLotRTdouble0.00Commission per 1.0 lot round turn (account ccy)
InpRiskModeENUM_GS_RISK_MODEGS_RISK_PERCENTPosition sizing mode
InpRiskPercentdouble0.50Risk per trade (% of equity/balance)
InpFixedLotdouble0.01Fixed lot (fixed mode only)
InpUseEquityForRiskbooltrueUse equity (true) or balance (false)
InpMaxRiskMultdouble1.00Max actual/planned risk multiplier (min-lot override)
InpMaxDailyLossPctdouble3.00Daily loss hard stop (% of day-start balance, 0 = off)
InpDailyLossClosePosbooltrueClose positions when daily limit is hit
InpMaxDrawdownPctdouble10.0Max drawdown from equity high-water mark (%, 0 = off)
InpMaxDDClosePosbooltrueClose positions when max drawdown is hit
InpMaxOpenRiskPctdouble2.00Max total open risk (% of equity, 0 = off)
InpMinFreeMarginPctdouble30.0Min free margin after entry (% of equity)
InpLossScopeENUM_GS_LOSS_SCOPEGS_SCOPE_EADaily loss scope

How to Install It

  1. 1Download the sourceUse "Download source (.zip)" above, or clone sepehrkafaeinezhad-hue/arena-ai-projects from GitHub, and unzip it.
  2. 2Open the data folderIn MetaTrader choose File, then Open Data Folder, and go to MQL5/Experts.
  3. 3Copy the filesCopy the .mq5 file into Experts.
  4. 4Compile in MetaEditorOpen the file in MetaEditor and press Compile. Fix any missing includes the compiler reports.
  5. 5Test before you tradeRun it in the Strategy Tester, then attach it to a demo chart and allow algorithmic trading.
Third-party code. ForexR did not write, test or endorse this EA, and the summary above was generated automatically from its README and code. ForexR lists only repositories with readable source code and never hosts files. Read the code, backtest it and use a demo account first; automated trading can lose money quickly.

Similar Expert Advisors

EA Scalper XAUUSD

by francomascareloai
266 stars

EA Scalper XAUUSD is an automated trading research project for MetaTrader 5 focused on gold. It employs a multifaceted entry strategy using Smart Money Concepts like order blocks and liquidity sweeps, alongside moving average crossovers and Fibonacci zones. The EA includes a self-learning module designed to adapt to di

MT5 Trading robot SMC / ICT / price actionIndicator crossoverScalping High risk
Updated 4 months ago Custom licence GitHub repository of EA Scalper XAUUSD

Gold Trader EA

by mehdi-jahani
141 stars

Gold Trader EA is a multi-strategy expert advisor designed for trading XAUUSD on the MetaTrader 5 platform. It employs a fusion engine that combines up to 14 different technical analysis methods, including candlestick patterns, chart patterns, price action, and institutional levels. The system requires a user-defined n

MT5 Trading robot Multi-strategyTrend followingIndicator crossover
Updated 1 year ago None stated GitHub repository of Gold Trader EA
87 stars

This MetaTrader 5 expert advisor implements Smart Money Concepts including Order Blocks, Fair Value Gaps, and Break of Structure entries. It features an automated mode that combines multiple strategies alongside market regime detection using ADX or Efficiency Ratio to ensure trading in trending conditions. Risk managem

MT5 Trading robot SMC / ICT / price actionTrend followingMulti-strategy
Updated 3 months ago Apache-2.0 GitHub repository of SMC Unified Expert Advisor

My Trading Bot

by carlosrod723
79 stars

This MetaTrader 5 expert advisor implements a multi-strategy framework based on Smart Money Concepts. It identifies fractal-based liquidity sweeps, order blocks, and Fibonacci zones across multiple timeframes, typically using H4 for trend direction and M15 for execution. The EA includes an optional machine learning fil

MT5 Trading robot SMC / ICT / price actionAI / machine learningMulti-strategy
Updated 11 months ago MIT GitHub repository of My Trading Bot

Fvg Gold EA

by foeed
44 stars

Fvg Gold EA is an automated trading robot for MetaTrader 5 designed specifically for the gold market. It utilizes institutional trading concepts by identifying high-probability Fair Value Gaps with Order Block confluence. The system employs a scoring algorithm to evaluate trade quality based on displacement, gap size,

MT5 Trading robot SMC / ICT / price actionIndicator crossover
Updated 5 weeks ago MIT GitHub repository of Fvg Gold EA

ICT Gold EA

by darula-hpp
36 stars

This automated trading system for MetaTrader 5 focuses on spot Gold using Inner Circle Trader methodology. It identifies entries through order block detection, market structure analysis, and weekly opening price levels. The strategy is further filtered by dual moving averages and specific trading sessions, primarily Lo

MT5 Trading robot SMC / ICT / price actionIndicator crossoverTrend following
Updated 1 year ago None stated GitHub repository of ICT Gold EA

More trading robots

Need a Broker for MT5?

Compare regulated brokers that support MetaTrader, with spreads, minimum deposits and leverage side by side.

Compare brokers