Collection · MT5

Optimizer XAUUSD Strategy

by alvinolima50

Optimizer XAUUSD Strategy is a MetaTrader 5 expert advisor collection designed to trade gold (XAUUSD) and US stock indices (US500 and USTEC100).

GitHub stars1
Forks0
Last update7 months ago13 Apr 2026
LicenceNone stated

Overview

The main robot enters buy and sell positions using a combination of EMA and SMA crossovers, moving average slope and ATR gap filters, MACD alignment, and an optional ADX trend filter. It exits trades on opposite moving average crossovers or via a bar-close ATR trailing stop. Position sizing relies on a fixed lot input rather than dynamic risk calculation, and the repository includes multiple timeframe variants without a README file.

Details

Author

alvinolima50 on GitHub

Type

Collection

Strategy

Trend following, Indicator crossover

Markets

Gold, Indices

Timeframes

M15-H1, H4 and above

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

NameTypeDefaultDescription
EMA_Periodint112
SMA_Periodint18
SignalTFENUM_TIMEFRAMESPERIOD_M30
MagicNumberlong20260315different from buy-only EA
SlippagePointsint10
EnableBuybooltruetrue = BUY trades active
EnableSellbooltruetrue = SELL trades active
FixedLotsdouble0.10
ATR_Periodint13
ATR_Filterdouble99.0disabled
ATR_TrailMultdouble4.8561
EMA_GapATR_Multdouble0.6950gap filter: Gap >= EMA_GapATR_Mult * ATR
Show all 26 inputs
NameTypeDefaultDescription
BUY_EMA_SlopeThresholddouble0.1496BUY entry: slope >= +0.1496
EMA_SlopeBarsint6bars used for slope (shared)
SELL_EMA_SlopeThresholddouble1.0151SELL entry: slope <= -1.0151
MACD_Fastint9
MACD_Slowint29
MACD_Signalint10
UseADXFilterbooltruetrue = block ranging/lateral market
ADX_Periodint14standard ADX period
ADX_MinTrenddouble22.0below this = lateral, skip entry
UseTimeFilterboolfalse
TradeStartHourint9
TradeEndHourint20
TradeBreakStartint11
TradeBreakEndint12

How to Install It

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

142 stars

This repository features a diverse collection of expert advisors and trading utilities for MetaTrader 4 and MetaTrader 5. It includes automated robots based on trendline analysis, session breakouts, and technical indicator crossovers using MACD, RSI, and Williams Percent Range. The library provides various tools for ri

MT4MT5 Collection Trend followingBreakoutGrid High risk
Updated 1 year ago None stated GitHub repository of Nkanven EA Collection
140 stars

This repository provides a collection of Expert Advisors for MetaTrader 5 and Python trading scripts developed for an educational YouTube series. It features various technical indicator-based strategies, including MACD, Relative Strength Index, Stochastic, and Bollinger Bands. The included MQL5 files implement multi-ti

MT5 Collection Indicator crossoverMean reversionTrend following
Updated 3 years ago None stated GitHub repository of Kecoma Trading Collection
100 stars

This collection for MetaTrader 5 provides a library and several expert advisors optimized for Renko chart trading. It includes a primary automated robot that executes trades based on Renko bar signals, as well as specific examples for moving average and price crossovers. The included tools offer robust trade management

MT5 Collection Trend followingIndicator crossoverBreakout

Sclab MQL5 Collection

by guilhermetabordaribas
75 stars

This MetaTrader 5 expert advisor collection provides a modular approach to automated trading based on technical indicators. It features a trading robot that uses a moving average to identify entries, supported by risk management tools including hard stop losses and take profits. The system includes logic for break-even

MT5 Collection Trend followingIndicator crossover
Updated 7 years ago None stated GitHub repository of Sclab MQL5 Collection
73 stars

This collection of MetaTrader 5 expert advisors provides a series of educational templates and multi-symbol trading robots. Developed as a companion to coding tutorials, the repository includes frameworks for building strategies using entry triggers and multiple filters. The included programs feature automated risk man

MT5 Collection Indicator crossoverTrend followingMulti-strategy
67 stars

This repository contains a large collection of over 100 expert advisors for the MetaTrader 5 platform, many of which appear to be generated using the Mission Automate tool. The library covers a wide variety of trading methodologies including range breakouts, Ichimoku cloud strategies, Heiken Ashi engulfing patterns, an

MT5 Collection Trend followingBreakoutMartingale High risk
Updated 3 years ago None stated GitHub repository of Konz MQL5 EA Collection

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