Trading robot · MT5

XAUUSD Basket Trailing EA

by Muhammad-TalhaK

This MetaTrader 5 expert advisor implements a basket-trading strategy specifically for XAUUSD.

High risk

GitHub stars2
Forks0
Last update4 months ago20 Jun 2026
LicenceNone stated

Overview

XAUUSD Basket Trailing EA opens an initial position based on the current short-term trend and enters additional trades at fixed intervals if the market moves against the basket. The robot utilizes a progressive lot-sizing model to manage the grid. Risk is controlled at the basket level with a global stop loss in points and a ratcheting profit-locking system that trails the total points gained. If the basket profit retraces to the locked floor, the EA closes all positions to bank the gain.

Details

Author

Muhammad-TalhaK on GitHub

Type

Trading robot

Markets

Gold

Timeframes

M1-M5, M15-H1

Risk Profile

  • Uses martingale lot scaling: losses can grow fast
  • Opens a grid of orders: exposure builds up in a trend

Input Parameters

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

NameTypeDefaultDescription
StartLotdouble—
LotStepdouble—
MaxTradesint—
StepPointsint—
TrailPointsint—Basket trailing distance (points)
MaxLossPointsint—Basket max loss (points)
TradeSymbolstringXAUUSDm
ProfitLockStartPointsint100start locking only after this profit
TFENUM_TIMEFRAMESPERIOD_M1

How to Install It

  1. 1Download the sourceUse "Download source (.zip)" above, or clone Muhammad-TalhaK/mt5-xauusd-basket-ea 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

Prem Gold Advisor

by Premkumar238
13 stars

Prem Gold Advisor is an automated MetaTrader 5 expert advisor specialized for XAUUSD (Gold) trading on the five-minute timeframe. It initiates trades using breakout levels placed at specific distances from the candle open. The strategy features a progressive scale-in mechanism, adding new orders as the price hits succe

MT5 Trading robot BreakoutTrend followingMartingale High risk
Updated 2 months ago None stated GitHub repository of Prem Gold Advisor

Smart Grid Martingale EA

by chenhengyi53-design
9 stars

This MetaTrader 5 expert advisor executes a grid trading strategy enhanced with martingale lot scaling. The system identifies market direction through multi-timeframe analysis using Exponential Moving Averages and the Average Directional Index. It features dynamic grid spacing that adjusts based on market volatility an

MT5 Trading robot GridMartingaleTrend following High risk
Updated 9 months ago None stated GitHub repository of Smart Grid Martingale EA

STO Martin

by crq644
3 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

Bot Trend

by uselinuxdev
3 stars

Bot Trend is a trend-following expert advisor for MetaTrader 5. It utilizes proprietary Francisca entry logic and manages trades through multiple concurrent execution threads. The system incorporates custom Zero Gravity step logic for position management and includes specific operational modes for Fridays and holidays.

MT5 Trading robot Trend followingGridMartingale High risk
Updated 9 months ago None stated GitHub repository of Bot Trend

IchiDCA CCBSN PropFirm EA

by magicniuniu
3 stars

IchiDCA CCBSN PropFirm EA is an automated trend-following robot for MetaTrader 5, optimized for gold and forex markets. It triggers trades based on Ichimoku Cloud breaks, filtered by dual Exponential Moving Averages and MACD indicators. The strategy manages positions through a Dollar Cost Averaging system that layers u

MT5 Trading robot Trend followingGridMean reversion High risk
2 stars

This Expert Advisor for MetaTrader 5 focuses on gold trading through a combination of mean-reversion signals and a grid management system. It uses multi-timeframe filters, including exponential moving averages and ADX on the H1 timeframe, to identify trend direction while executing entries on M15 based on RSI and Bolli

MT5 Trading robot Mean reversionGridMartingale High risk

More gold EAs

Related on ForexR

Need a Broker for MT5?

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

Compare MT5 brokers