Trading robot · MT5

XAUUSD Scalper

by kezyandrew

Xauusd Scalper is a regime-adaptive Expert Advisor designed for MetaTrader 5, specifically optimized for the XAUUSD (Gold) M5 timeframe.

GitHub stars1
Forks0
Last update7 days ago27 Sep 2026
LicenceNone stated

Overview

XAUUSD Scalper integrates four distinct strategy modules—SweepReversal, VolBreakout, TrendPullback, and MeanReversion—under a shared risk manager. The EA automatically classifies market conditions and applies the most suitable strategy. Risk management features include equity-drawdown-aware lot sizing, a daily loss limit, an equity breaker, and trailing stops based on Average True Range. Note that calendar news filtering is unavailable during strategy backtesting.

Details

Author

kezyandrew on GitHub

Type

Trading robot

Platform

MetaTrader 5 (MQL5)

Strategy

Trend following, Breakout, Mean reversion

Markets

Gold

Timeframes

M1-M5

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 XauusdScalper.mq5. Defaults are the author's; change them in the EA's Inputs tab.

NameTypeDefaultDescription
InpMagiclong26092300Base magic (strategies use +1..+9)
InpSignalTFENUM_TIMEFRAMESPERIOD_M5Signal timeframe
InpCommentstringXSOrder comment prefix
InpShowDashboardbooltrueShow on-chart status
InpRiskProfileENUM_RISK_PROFILEPROFILE_BALANCEDRisk profile
InpRiskBaseENUM_RISK_BASERISK_BASE_MINRisk % is taken from
InpMaxDrawdownPercentdouble0.0Max equity DD % (0 = use profile)
InpMaxLotsdouble0.0Hard lot cap (0 = none)
InpMaxMarginUsePctdouble30.0Max % of free margin per new trade
InpMinLotRiskTolerancedouble1.5Allow min lot up to N x target risk
InpCommissionPerLotdouble7.0Round-turn commission per lot (account ccy)
InpDailyProfitTargetPctdouble0.0Stop new trades after +X% today (0 = off)
Show all 40 inputs
NameTypeDefaultDescription
InpDDPauseHoursint24Breaker pause hours (0 = halt until reset)
InpCloseOnBreakerboolfalseClose all when equity-DD breaker trips
InpCloseOnDailyLimitbooltrueClose all when daily loss limit hits
InpRequireRiskFreeToAddboolfalseAdd positions only if others are at breakeven
InpMinMinutesBetweenint3Minimum minutes between entries
InpResetRiskStateboolfalseReset persisted peak / limits / breaker
InpCRiskPctdouble1.0Risk per trade %
InpCDailyLossPctdouble3.0Daily loss limit %
InpCMaxDDPctdouble12.0Max drawdown breaker %
InpCThrottleDDPctdouble6.0Throttle risk from drawdown %
InpCThrottleFactordouble0.5Risk multiplier while throttled
InpCMaxPositionsint2Max open positions
InpCMaxOpenRiskPctdouble2.0Max total open risk %
InpCMaxTradesPerDayint18Max entries per day
InpCSlAtrMultdouble1.8Base stop = ATR x
InpCMaxStopAtrMultdouble3.5Skip if stop must exceed ATR x
InpCBeTriggerRdouble0.8Breakeven trigger (R)
InpCBeLockRdouble0.1Profit locked at breakeven (R)
InpCPartialPctdouble50.0% closed at breakeven trigger
InpCTrailStartRdouble1.0Start trailing at (R)
InpCTrailAtrMultdouble1.8Trailing distance ATR x
InpCTpRdouble1.8Take profit (R, 0 = trail only)
InpCLossStreakint3Losing streak length for cool-down
InpCLossStreakFactordouble0.5Risk multiplier after streak
InpCLossStreakPauseMinint30Cool-down minutes after streak
InpStructBufferAtrdouble0.3Buffer beyond structure / sweep extreme (ATR)
InpMinStopDistancedouble3.0Absolute minimum stop (price units, $ on gold)
InpMinStopSpreadMultdouble8.0Stop >= spread x

How to Install It

  1. 1Download the sourceUse "Download source (.zip)" above, or clone kezyandrew/xauusd-scalper 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, and any .mqh files into the Include folder the code expects.
  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

Nolo Trading Bot

by festomanolo
4 stars

This expert advisor for MetaTrader 5 is a multi-strategy system that utilizes market regime detection to switch between trend following, range trading, and breakout modes. It incorporates a wide array of technical indicators, including Moving Averages, RSI, MACD, Ichimoku, and SuperTrend. The bot manages risk through v

MT5 Trading robot Trend followingMean reversionBreakout High risk
Updated 6 months ago MIT GitHub repository of Nolo Trading Bot

EA SMC Engine

by Pauloeduspbr
3 stars

This automated trading robot for MetaTrader 5 implements Smart Money Concepts (SMC) and ICT principles using a hybrid architecture. Trading logic and signal detection are processed within a native C++ DLL, while the MQL5 bridge handles trade execution and data feeding. The system identifies market structure shifts, inc

MT5 Trading robot SMC / ICT / price actionBreakoutTrend following
Updated 6 months ago MIT GitHub repository of EA SMC Engine
2 stars

This MetaTrader 5 expert advisor combines Bollinger Band mean-reversion, squeeze breakouts, and EMA crossover trend following. It filters for ranging markets using a long-period EMA slope to execute reversal trades with candlestick confirmation, specifically identifying Doji patterns at the bands. Risk management inclu

MT5 Trading robot Mean reversionBreakoutIndicator crossover

This MetaTrader 5 expert advisor executes a multi-stage trading strategy focusing on H1 trendline breakouts and RSI divergences. It refines entries on the M5 timeframe using Change of Character and micro Break of Structure signals. The EA includes automated risk management with percentage-based lot sizing and ATR-based

MT5 Trading robot SMC / ICT / price actionBreakoutTrend following
2 stars

This MetaTrader 5 expert advisor focuses on the EURUSD pair using an adaptive market regime approach. It alternates between trend-following and mean-reversion logic based on ADX and EMA indicators. The trend strategy utilizes price breakouts or pullbacks confirmed by RSI, while the range strategy employs Bollinger Band

MT5 Trading robot Trend followingBreakoutMean reversion

Gold FX EA

by ajeet-trader
1 stars

Gold FX EA is a multi-asset trading robot for MetaTrader 5 that functions as a modular framework for various technical strategies. It allows users to toggle specific modules for forex, gold, silver, cryptocurrencies, and commodities. Strategies include trend following with moving averages, Bollinger Band mean reversion

MT5 Trading robot Trend followingBreakoutMean reversion
Updated 9 months ago None stated GitHub repository of Gold FX 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