Trading robot · MT5

XAU And GC Arbitrage

by qiin

This MetaTrader 5 expert advisor implements a pair trading arbitrage strategy between spot gold and gold futures.

GitHub stars1
Forks0
Last update6 months ago11 Mar 2026
LicenceNone stated

Overview

The robot monitors the price difference between XAUUSD and the GC futures contract, opening simultaneous buy and sell orders when the spread exceeds a defined threshold. Risk management is handled through a basket-based system, closing all related positions once a specific USD profit or loss target is reached. It includes a graphical interface for real-time monitoring and requires a license key to operate. The EA supports automated entry logic and limits the maximum number of active trade pairs.

Details

Author

qiin on GitHub

Type

Trading robot

Platform

MetaTrader 5 (MQL5)

Strategy

Arbitrage, Hedging

Markets

Gold, Oil & commodities

Timeframes

Any timeframe

Risk profile

  • Holds opposite positions at once

Input parameters

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

NameTypeDefaultDescription
InpLicenseKeystringLicense Key
InpTakeProfitdouble500.0止盈金额(USD)
InpStopLossdouble300.0止损金额(USD)
InpTPBufferdouble5.0止盈提前触发量(USD)
InpMagicNumberint20240101Magic Number
InpTimerMsint500监控间隔(毫秒)
InpDefaultSymAstringXAUUSD品种A
InpDefaultSymBstringGC品种B
InpDefaultLotsAdouble0.1手数A
InpDefaultLotsBdouble0.1手数B
InpSpreadAutoOpenboolfalse启用基差自动开仓
InpSpreadThresholddouble5.0基差开仓阈值(绝对值)
Show all 13 inputs
NameTypeDefaultDescription
InpSpreadMaxPairsint3基差开仓最大同时持仓对数

How to install it

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

3 stars

This expert advisor facilitates arbitrage trading between futures and spot instruments, primarily targeting gold and stock indices. Available for MetaTrader 4 and 5, it monitors the price difference between two related symbols against a moving average to identify trade opportunities. The logic includes a noise-filterin

MT4MT5 Trading robot ArbitrageMean reversionGrid High risk
Updated 3 years ago None stated GitHub repository of Gold Futures Spot Arbitrage

Triangular Arbitrage MT5

by chrisyeh75
1 stars

This MetaTrader 5 expert advisor implements a triangular arbitrage strategy targeting price discrepancies between correlated currency pairs. The robot monitors specific instruments, including EURUSD, USDJPY, EURJPY, USDCAD, and CADJPY, to identify synthetic price gaps. It executes trades when the calculated gap exceeds

MT5 Trading robot ArbitrageHedging
Updated 9 years ago None stated GitHub repository of Triangular Arbitrage MT5

Take Profit Oil Arbitrage

by iceandfire1981
1 stars

This MetaTrader 4 expert advisor implements a pairs trading or statistical arbitrage strategy primarily designed for energy commodities like USOIL and UKOIL. It monitors the price differential between two correlated assets over a specific lookback period to identify mean-reversion opportunities. The robot executes simu

MT4 Trading robot ArbitrageMean reversionHedging
Updated 7 years ago None stated GitHub repository of Take Profit Oil Arbitrage

Nyao Scalper

by elrizwiraswara
173 stars

Nyao Scalper is an automated scalping robot for MetaTrader 5 that utilizes a multi-factor weighted scoring system to identify trade opportunities. It evaluates trend alignment through EMA crossovers, momentum via RSI, and price action through wick rejection and candle body analysis. The EA manages risk with adaptive AT

MT5 Trading robot ScalpingTrend followingMartingale High risk
Updated 3 months ago BSD-3-Clause GitHub repository of Nyao Scalper

HFT Arbitrage EA

by HFTHaidra
132 stars

This high-frequency trading robot implements latency arbitrage by comparing price feeds across two separate MetaTrader terminals. It requires a fast data source to serve as a reference and a slower broker where price delivery lags behind the market. The EA communicates between instances via a socket library to detect p

MT4MT5 Trading robot Arbitrage
Updated 9 months ago None stated GitHub repository of HFT Arbitrage EA
18 stars

This expert advisor for MetaTrader 5 utilizes a genetic algorithm and neural network to make autonomous trading decisions without relying on traditional technical indicators. It implements a self-learning mechanism that evaluates a population of species to determine entry, exit, and lot sizing across multiple currency

MT5 Trading robot AI / machine learningHedging

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