Trading robot · MT5

Mr X Grid Hedge

by ibrahimzameel9232-lgtm

Mr X Grid Hedge is a MetaTrader 5 expert advisor specifically designed for XAUUSD trading.

High risk

GitHub stars2
Forks3
Last update12 months ago12 Nov 2025
LicenceNone stated

Overview

Mr X Grid Hedge utilizes a grid strategy with entry signals confirmed by a combination of EMA crossovers, RSI bounds, and ATR volatility filters. The system manages risk through automated hedging triggered by drawdown or specific grid depth. Users can choose between fixed, incremental, or martingale lot progression. The EA includes emergency drawdown protection and a weekend closing feature, but lacks traditional individual stop losses, relying instead on basket closures and equity guards.

Details

Author

ibrahimzameel9232-lgtm on GitHub

Type

Trading robot

Strategy

Grid, Martingale, Hedging, Indicator crossover

Markets

Gold

Timeframes

M15-H1

Risk Profile

  • Uses martingale lot scaling: losses can grow fast
  • Opens a grid of orders: exposure builds up in a trend
  • Holds opposite positions at once
  • Trades without a fixed stop loss

Input Parameters

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

NameTypeDefaultDescription
StartingLotSizedouble0.01Starting Lot Size
GridDistancePipsint100Grid Distance in Points ($10 for XAUUSD)
MaxGridLevelsint10Maximum Grid Positions (Safety Limit)
ProfitTargetUSDdouble30.0Profit Target in USD
EnableHedgingbooltrueEnable Hedging When Drawdown Increases
FastEMA_Periodint20Fast EMA Period
SlowEMA_Periodint50Slow EMA Period
RSI_Periodint14RSI Period
RSI_LowerBoundint40RSI Lower Bound (avoid oversold)
RSI_UpperBoundint60RSI Upper Bound (avoid overbought)
ATR_Periodint14ATR Period
MinATR_Valuedouble5.0Minimum ATR for Entry (volatility filter)
Show all 32 inputs
NameTypeDefaultDescription
EntryTimeframeENUM_TIMEFRAMESPERIOD_M15Timeframe for Entry Analysis
LotMethodLOT_PROGRESSION_METHODINCREMENTALLot Progression Method
IncrementStepdouble0.01Increment Step (for INCREMENTAL method)
HedgeTriggerLevelint6Hedge After N Grid Levels
HedgeTriggerDrawdownPctdouble25.0Hedge at Drawdown % (of balance)
MaxDrawdownPctdouble40.0CRITICAL: Force Close All at Drawdown %
MaxLotSizedouble1.0Maximum Lot Size (Safety Cap)
CloseOnWeekendbooltrueClose All Positions Before Weekend
WeekendClosureHourint21Friday Hour to Close (Server Time)
CloseOnHighDrawdownbooltrueAuto-close at max drawdown
BreakevenCloseThresholddouble5.0Close at breakeven if within $X
UseTradeTimeFilterboolfalseEnable Trading Hours Filter
TradeStartHourint8Start Trading Hour (Server Time)
TradeEndHourint20End Trading Hour (Server Time)
AllowNewEntriesbooltrueAllow New Initial Entries
MinMinutesBetweenEntriesint60Min Minutes Between Initial Entries
ShowDebugInfobooltrueShow Debug Info in Logs
Slippageint10Maximum Slippage in Points
MagicNumberlong123456Magic Number for This EA
TradeCommentstringGridHedge_MCTrade Comment

How to Install It

  1. 1Download the sourceUse "Download source (.zip)" above, or clone ibrahimzameel9232-lgtm/Mr.X 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

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

AutoTrade EA

by liucheng-12-08
3 stars

AutoTrade EA is a scalping robot for MetaTrader 4 and 5 that utilizes a multi-indicator signal scoring system based on Exponential Moving Average crossovers and RSI levels. It employs an aggressive trade management strategy featuring a dynamic grid and a stepped martingale lot scaling system where position sizes increa

MT4MT5 Trading robot ScalpingIndicator crossoverMartingale High risk
Updated 8 months ago None stated GitHub repository of AutoTrade EA

Xauusd Auto Trader

by ibadnarpatih-create
2 stars

This MetaTrader 5 expert advisor is designed for trading XAUUSD using a trend-following approach. It identifies entries through a triple Exponential Moving Average crossover system, requiring ADX momentum confirmation before opening positions. To manage losing trades, the EA employs a martingale strategy that layers or

MT5 Trading robot Trend followingIndicator crossoverMartingale High risk
Updated 2 months ago GPL-3.0 GitHub repository of Xauusd Auto Trader

Price Less EA

by exalkas
2 stars

Price Less EA is an automated trading robot for the MetaTrader 4 platform that implements a grid-based recovery strategy. It combines moving average crossovers for entry timing with a multi-level position layering system. The robot initiates trades and scales lot sizes using step-based increments at fixed distances. It

MT4 Trading robot GridIndicator crossoverMartingale High risk
Updated 8 years ago None stated GitHub repository of Price Less EA
1 stars

Integra 777 Buy Sell is a MetaTrader 4 expert advisor that utilizes a grid-based approach combined with the Commodity Channel Index (CCI) for trade entries and management. The robot opens positions and adds supplementary orders at dynamic distances, governed by a minimum step parameter. It features a unique trailing pr

MT4 Trading robot GridMartingaleIndicator crossover High risk
Updated 9 years ago None stated GitHub repository of Integra 777 Buy Sell

Grid Martingale TA Signals

by SrisittikumChanintorn
1 stars

This MetaTrader 4 expert advisor executes a dual-direction grid trading strategy driven by technical analysis. It enters trades based on an Exponential Moving Average crossover logic using three distinct periods. The system employs a customizable martingale sequence where lot sizes increase after a user-defined number

MT4 Trading robot Indicator crossoverGridMartingale High risk
Updated 1 year ago None stated GitHub repository of Grid Martingale TA Signals

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