Trading robot · MT5

Xauusdt MT5

by 4everfantasygaming

Xauusdt MT5 is an automated trading robot for MetaTrader 5, specifically optimized for gold trading.

High risk

GitHub stars1
Forks0
Last update5 months ago4 Apr 2026
LicenceNone stated

Overview

Xauusdt MT5 executes a grid-based strategy with martingale lot scaling, where position sizes are increased by a user-defined multiplier after losses. The system features a dual-stage grid distance mechanism that adjusts spacing based on current floating drawdown thresholds. Risk management is handled through basket profit targets, maximum spread filters, and specific price ceilings or floors for order entry. The expert advisor includes time-based session controls and supports hedging through trend and counter-trend protection settings.

Details

Author

4everfantasygaming on GitHub

Type

Trading robot

Platform

MetaTrader 5 (MQL5)

Strategy

Grid, Martingale, Hedging

Markets

Gold

Timeframes

Any timeframe

Risk profile

  • Uses martingale lot scaling: losses can grow fast
  • Opens a grid of orders: exposure builds up in a trend
  • Holds opposite positions at once
  • Trades without a fixed stop loss

Input parameters

Read from 天哥启程.mq5. Defaults are the author's; change them in the EA's Inputs tab.

NameTypeDefaultDescription
On_top_of_this_price_not_Buy_first_orderdouble0.0B以上不开(首)
On_under_of_this_price_not_Sell_first_orderdouble0.0S以下不开(首)
On_top_of_this_price_not_Buy_orderdouble0.0B以上不开(补)
On_under_of_this_price_not_Sell_orderdouble0.0S以下不开(补)
Limit_StartTimestring00:00限价开始时间
Limit_StopTimestring24:00限价结束时间
CloseBuySellbooltrue逆势保护开?
HomeopathyCloseAllbooltrue顺势保护开?
Homeopathyboolfalse完?
Overboolfalse平仓后停止交易
NextTimeint0整体平仓后多少秒后新局
Moneydouble2000.0浮亏多少启用第二参数
Show all 40 inputs
NameTypeDefaultDescription
FirstStepint30首单距离
MinDistanceint60最小距离
TwoMinDistanceint220第二最小距离
StepTrallOrdersint5挂单追踪点数
Stepint200补单间距
TwoStepint600第二补单间距
OpenModeENUM_OPEN_MODEMODE_NO_DELAY2OpenMode
TimeZoneENUM_TIME_ZONETZ_1MIN开单时区
sleepint30开单时间间距(秒)
MaxLossdouble10000.0单边浮亏?
MaxLossCloseAlldouble50.0单边平仓限制
lotdouble0.01起始手数
Maxlotdouble2.0最大开单手数
PlusLotdouble0.0累加手数
K_Lotdouble1.3倍率
DigitsLotint2下单量的小数位
CloseAlldouble0.5整体平仓金额
Profitbooltrue单边平仓额累加开?
StopProfitdouble2.0单边平仓金额
StopLossdouble0.0止损金额
Magicint958999848Magic
Totalsint50最大单量
MaxSpreadint100点差限制
Leverageint100平台杠杆限制
EA_StartTimestring00:00EA开始时间
EA_StopTimestring24:00EA结束时间
clr1colorclrMediumSeaGreen多单平均价颜色
clr2colorclrCrimson空单平均价颜色

How to install it

  1. 1Download the sourceUse "Download source (.zip)" above, or clone 4everfantasygaming/xauusdt_mt5 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

AutoTrade EA

by liucheng-12-08
3 stars

AutoTrade EA is a scalping robot for MetaTrader 4 and 5 that utilizes a multi-indicator signal scoring system based on Exponential Moving Average crossovers and RSI levels. It employs an aggressive trade management strategy featuring a dynamic grid and a stepped martingale lot scaling system where position sizes increa

MT4MT5 Trading robot ScalpingIndicator crossoverMartingale High risk
Updated 7 months ago None stated GitHub repository of AutoTrade EA

Grid Hedge Combine

by Far-1d
3 stars

Grid Hedge Combine is a MetaTrader 5 expert advisor designed to automate market entries using a mixture of grid and hedging techniques. It opens initial trades and layers subsequent orders at predefined pip intervals when the price moves against the position. The EA features lot size scaling, allowing for aggressive or

MT5 Trading robot GridMartingaleHedging High risk
Updated 1 year ago None stated GitHub repository of Grid Hedge Combine

Mr X Grid Hedge

by ibrahimzameel9232-lgtm
2 stars

Mr X Grid Hedge is a MetaTrader 5 expert advisor specifically designed for XAUUSD trading. It utilizes a grid strategy with entry signals confirmed by a combination of EMA crossovers, RSI bounds, and ATR volatility filters. The system manages risk through automated hedging triggered by drawdown or specific grid depth.

MT5 Trading robot GridMartingaleHedging High risk
Updated 10 months ago None stated GitHub repository of Mr X Grid Hedge

STO Martin

by crq644
2 stars

STO Martin is a grid-based trading robot for MetaTrader 5 that uses technical indicators to manage entries and recoveries. It employs a Stochastic Oscillator for execution signals and a Moving Average to filter trades according to the prevailing trend. The EA features a martingale lot-scaling system that adds positions

MT5 Trading robot MartingaleGridTrend following High risk
Updated 3 years ago None stated GitHub repository of STO Martin

AW Full Recovery EA

by wongthep
2 stars

This MetaTrader 5 expert advisor functions as a grid-based recovery system that can operate independently or manage trades from external EAs via magic number filtering. It initiates entries using Bollinger Bands and RSI indicators, then manages drawdown through a recovery grid matrix. The system employs dynamic ATR-bas

MT5 Trading robot GridMartingaleHedging High risk
Updated 3 months ago None stated GitHub repository of AW Full Recovery EA

Xauusd Auto Trader

by ibadnarpatih-create
2 stars

This MetaTrader 5 expert advisor is designed for trading XAUUSD using a trend-following approach. It identifies entries through a triple Exponential Moving Average crossover system, requiring ADX momentum confirmation before opening positions. To manage losing trades, the EA employs a martingale strategy that layers or

MT5 Trading robot Trend followingIndicator crossoverMartingale High risk
Updated 3 weeks ago GPL-3.0 GitHub repository of Xauusd Auto Trader

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