Trading robot · MT5

GoldScalperM15

by Kla1524

The GoldScalperM15 EA is an automated trading robot for XAUUSD gold on the M15 timeframe.

GitHub stars1
Forks0
Last update2 days ago17 Oct 2026
LicenceMIT

Overview

GoldScalperM15 records the Asian session high and low from 00:00 to 08:00 server time and enters a single trade per day on the first M15 candle that breaks the range, either buy or sell. Lot size follows a strict 0.5% risk of equity using the ATR-based stop loss. Optional trend EMA filter and volatility filter require sufficient daily ATR. Exits occur at 20:00 server time or before Friday close to avoid overnight swaps. Risk controls include daily loss limits, maximum drawdown halts, loss streak pauses, news filters around high-impact events, and position size caps. It provides an on-chart panel and PowerShell console for monitoring.

Details

Author

Kla1524 on GitHub

Type

Trading robot

Platform

MetaTrader 5 (MQL5)

Strategy

Breakout

Markets

Gold

Timeframes

M15-H1

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.

Topics

expert-advisorforexgoldmetatrader5mql5trading-botxauusd

Input Parameters

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

NameTypeDefaultDescription
InpLotModeENUM_LOT_MODELOT_RISKLot sizing (risk % follows the account size)
InpLotsdouble0.01Fixed lot (when lot sizing = fixed)
InpRiskPctdouble0.5Risk % of equity per trade (when lot sizing = risk %)
InpMagiculong20261013Magic number
InpTFENUM_TIMEFRAMESPERIOD_M15Signal timeframe
InpAllowBuybooltrueAllow buys
InpAllowSellbooltrueAllow sells
InpTrendTFENUM_TIMEFRAMESPERIOD_CURRENTTrend EMA timeframe (CURRENT = signal timeframe)
InpTrendEMAint200Trend EMA period
InpUseTrendboolfalseAlso require the close beyond the trend EMA
InpRangeStartHourint0Range start (hour, server time)
InpRangeEndHourint8Range end / breakouts from (hour, server time)
Show all 40 inputs
NameTypeDefaultDescription
InpStopEntryboolfalseEnter with BUY STOP / SELL STOP orders at the range edges (the other side is cancelled on a fill) instead of waiting for
InpStopEntryBufPtsint0Stop-entry: extra distance beyond the range edge (points)
InpRSIPeriodint14RSI period (confidence score, journal)
InpATRPeriodint14ATR period
InpSL_ATRdouble4.0SL = ATR x
InpTP_ATRdouble0.0TP = ATR x (0 = no take-profit)
InpBE_ATRdouble0.0Move SL to breakeven at profit >= ATR x (0 = off)
InpTrail_ATRdouble0.0Trailing distance ATR x (0 = off)
InpTrailStart_ATRdouble-1Start trailing at profit >= ATR x (-1 = same as the trailing distance)
InpStartHourint0Trading starts (hour, server time)
InpEndHourint18No new trades from (hour, server time)
InpMaxSpreaddouble1.00Max spread (price units, e.g. 0.40 = 40 cents)
InpMinATRdouble0.0Min ATR (price units, 0 = off)
InpMinDailyATRPctdouble1.6Min daily ATR as % of price (0 = off): trade only volatile days
InpStrictRiskbooltrueSkip a trade if its real risk (vs equity) exceeds the risk % (risk-% sizing)
InpSlippagePtsint30Slippage allowance at the SL (points), counted in the real risk
InpCommissionLotdouble0.0Round-turn commission per 1 lot (account currency; XM Standard = 0)
InpMaxRiskPctdouble5.0Hard cap: skip if the SL would lose more than % of equity (0 = off)
InpMaxTradesPerDayint1Trades per day (the first breakout of the day; 0 = unlimited, not recommended)
InpMaxDailyLossPctdouble3.0Daily loss limit, % of start-of-day balance (0 = off)
InpMaxDDPctdouble20.0Halt: pause when equity falls this % below its peak (0 = off)
InpMaxLossStreakint5Halt: pause after this many losing trades in a row (0 = off)
InpMaxLosingDaysint0Halt: pause after this many losing days in a row (0 = off; test before use)
InpMaxLotdouble0.0Max lot per trade (0 = off)
InpMaxExposuredouble10.0Max position value as a multiple of equity, caps the lot (0 = off)
InpDailyCloseHourint20Close all trades daily at this hour (avoids swap, -1 = off)
InpCloseFridaybooltrueClose trades before the Friday market close
InpFridayCloseHourint21Friday close hour (server time)

How to Install It

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

Gold ORB

by yulz008
295 stars

This MetaTrader 5 expert advisor implements an open range breakout strategy specifically designed for gold trading on the hourly timeframe. It identifies the high and low of the initial trading hour and establishes a definitive range after a user-defined consolidation period. Trades are triggered when price breaks thro

MT5 Trading robot Breakout
Updated 3 years ago None stated GitHub repository of Gold ORB

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 4 months ago BSD-3-Clause GitHub repository of Nyao Scalper

Golden Strategist EA

by raracraz
70 stars

This MetaTrader 5 expert advisor specializes in trading Gold (XAUUSD) by targeting volatility during the New York session. It utilizes an Average True Range (ATR) indicator to identify market trends and determine entry levels for limit orders. Risk management includes fixed stop loss parameters and dynamic trailing sto

MT5 Trading robot Trend followingBreakout
Updated 2 years ago None stated GitHub repository of Golden Strategist EA

Black XAU Automated Bot

by phatnomenal
52 stars

Black XAU is an automated trading robot for MetaTrader 5, specifically designed for gold. It utilizes a multi-timeframe breakout and retest strategy, identifying trading zones based on initial H4 market structure. Entries are triggered on the M5 timeframe when price retests a confirmed breakout level. The expert adviso

MT5 Trading robot BreakoutTrend following
Updated 1 year ago None stated GitHub repository of Black XAU Automated Bot

Box Breakout EA

by je-zhou
27 stars

This MetaTrader 5 expert advisor implements a box breakout strategy designed for the foreign exchange market. The robot identifies price ranges during specific time windows and enters trades upon a breakout. It features a trend filter using fast and slow moving averages to align entries with broader market direction. R

MT4MT5 Trading robot BreakoutTrend following
20 stars

First Candle Breakout is a MetaTrader 5 expert advisor designed to trade the breakout of the high or low of the first candle within a specified period. While traditionally used with the first 60-minute candle, the software allows users to configure any timeframe for the initial range. The robot enters a buy position wh

MT5 Trading robot Breakout

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