Trading robot · MT5

XAUUSD Reversal in Trend

by 30blekok-stack

XAUUSD Reversal in Trend is a MetaTrader 5 expert advisor designed for M1 scalping on gold.

GitHub stars1
Forks0
Last update2 months ago26 Jul 2026
LicenceNone stated

Overview

XAUUSD Reversal in Trend employs a trend-following pullback strategy, identifying entry opportunities using RSI or Stochastic oscillators at extreme zones combined with candle rejection confirmations. To ensure alignment with broader market conditions, the EA filters setups using moving average slope and ADX on higher timeframes like M15 or H1. Trade management utilizes a single-entry model without grid or martingale mechanics, enforcing protection through adaptive stop-loss configurations, breakeven triggers, and trailing stops.

Details

Author

30blekok-stack on GitHub

Type

Trading robot

Platform

MetaTrader 5 (MQL5)

Strategy

Trend following, Mean reversion, Scalping

Markets

Gold

Timeframes

M1-M5

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

NameTypeDefaultDescription
InpTrendTimeframeENUM_TIMEFRAMESPERIOD_M15TF penentu tren (M15 default, boleh H1)
InpTrendEMAPeriodint50Periode EMA tren
InpUseSlopeFilterbooltrueAktifkan filter kemiringan EMA
InpSlopeLookbackint5Bar lookback untuk hitung slope
InpMinSlopePointsdouble10.0Ambang minimal slope (points) agar tak dianggap datar
InpUseADXFilterbooltrueAktifkan filter kekuatan tren (ADX)
InpADXTimeframeENUM_TIMEFRAMESPERIOD_M15TF ADX (default = TF tren)
InpADXPeriodint14Periode ADX
InpADXMinLeveldouble25.0ADX minimal agar entry diizinkan
InpOscModeENUM_OSC_MODEOSC_RSIPilihan oscillator
InpRSIPeriodint14Periode RSI
InpRSIBuyLeveldouble40.0Level oversold RSI untuk BUY (longgar)
Show all 40 inputs
NameTypeDefaultDescription
InpRSISellLeveldouble60.0Level overbought RSI untuk SELL (longgar)
InpStochKint5%K Stochastic
InpStochDint3%D Stochastic
InpStochSlowingint3Slowing Stochastic
InpStochBuyLeveldouble30.0Zona oversold Stochastic (BUY)
InpStochSellLeveldouble70.0Zona overbought Stochastic (SELL)
InpSignalValidBarsint3Masa berlaku sinyal (bar) setelah cross
InpSameBarOnlyboolfalsetrue = cross & candle konfirmasi harus 1 bar (paling ketat)
InpMinWickRatiodouble0.30Rasio minimal rejection wick / total range
InpMinClosePositiondouble0.50Posisi close minimal di paruh atas(BUY)/bawah(SELL)
InpMinRangeATRRatiodouble0.0Range minimal = rasio x ATR (0 = nonaktif)
InpSLModeENUM_SL_MODESL_CONFIRMMode SL (ConfirmCandle direkomendasikan)
InpSLBufferPointsint20Buffer SL (points)
InpSwingLookbackint10Lookback swing (mode SwingLowHigh)
InpATRPeriodint14Periode ATR (M1)
InpATRMultSLdouble1.5Multiplier ATR untuk SL (mode ATR)
InpMinSLPointsint50Jarak SL minimal (points) - kalau lebih rapat, dilebarkan
InpMaxSLPointsint800Jarak SL maksimal (points) - kalau lebih lebar, entry dibatalkan
InpUseBreakevenbooltrueAktifkan breakeven
InpBreakevenTriggerPointsint100Profit (points) untuk mengunci breakeven
InpBreakevenBufferPointsint5Buffer breakeven (dipakai sebagai NILAI MINIMUM)
InpCommissionPointsint0Komisi round-turn dalam points (untuk buffer BE)
InpUseTrailingbooltrueAktifkan trailing (hanya jalan setelah breakeven ter-set)
InpTrailModeENUM_TRAIL_MODETRAIL_ATRMode trailing
InpATRMultTraildouble1.5Multiplier ATR untuk trailing
InpTrailDistancePointsint150Jarak trailing tetap (mode FixedStep)
InpTrailStepPointsint30Step geser trailing (mode FixedStep)
InpTrailEMAPeriodint20Periode EMA trailing (mode EMA)

How to Install It

  1. 1Download the sourceUse "Download source (.zip)" above, or clone 30blekok-stack/EA-MT5---M1-Reversal-in-Trend 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

Scalpflip EA

by anthonycdp
25 stars

Scalpflip EA is an automated scalping robot for MetaTrader 5 that utilizes a multi-layered technical analysis approach. It offers three entry modes: trend-following, mean-reversion, and a smart mode that selects the strategy based on current market conditions. The system filters trades using the Relative Strength Index

MT5 Trading robot ScalpingTrend followingMean reversion
Updated 1 year ago None stated GitHub repository of Scalpflip EA

FG Scalping Pro

by FaizGusion00
11 stars

FG Scalping Pro is an automated trading system for MetaTrader 5 that utilizes a multi-indicator approach to identify entry points. It combines exponential moving average crossovers with RSI momentum and Bollinger Band volatility filters to execute trades. The EA manages risk through dynamic ATR-based stop loss and take

MT5 Trading robot ScalpingIndicator crossoverMean reversion
Updated 1 year ago Custom licence GitHub repository of FG Scalping Pro
9 stars

This MetaTrader 5 expert advisor collection provides multiple variants for scalping gold on the one-minute timeframe. It utilizes a combination of Stochastic Oscillator crossovers and linear regression analysis to identify trend quality and entry points. Trade management is handled through ATR-based dynamic stop loss a

MT5 Trading robot ScalpingTrend followingMean reversion

Simba Sniper EA

by oriokie
6 stars

This MetaTrader 5 expert advisor focuses on XAUUSD using a multi-timeframe scalping approach based on Smart Money Concepts. It identifies institutional market structures by analyzing H4 trends, H1 supply and demand zones, and M5 entries. The logic incorporates order block detection, Fair Value Gaps (FVG), and liquidity

MT5 Trading robot SMC / ICT / price actionScalpingTrend following High risk
Updated 8 months ago Custom licence GitHub repository of Simba Sniper EA

Snipe FX Pro

by NadirAliOfficial
6 stars

Snipe FX Pro is a MetaTrader 5 expert advisor designed for high-frequency tick scalping, primarily pre-configured for XAUUSD. It utilizes a virtual stealth execution system to manage entries and exits without placing hard stops on the broker's server until necessary. The EA enters trades based on price breakouts or pul

MT5 Trading robot ScalpingTrend followingMean reversion
Updated 7 weeks ago None stated GitHub repository of Snipe FX Pro

EA Ak47 Hybrid

by JonusNattapong
1 stars

EA Ak47 Hybrid is a modular scalping expert advisor for MetaTrader 5, specifically optimized for gold markets. It generates signals using the Relative Strength Index filtered by an Exponential Moving Average trend component. The EA includes secondary filters for ATR volatility, MACD momentum, and Stochastic oscillators

MT5 Trading robot ScalpingTrend followingMartingale High risk
Updated 10 months ago Custom licence GitHub repository of EA Ak47 Hybrid

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