Trading robot · MT5

H4 EMA Pullback Next Level

by Mohamed-Kathree

This Expert Advisor for MetaTrader 5 implements a trend-following strategy on the H4 timeframe by identifying pullbacks to the 50-period Exponential Moving Average.

GitHub stars1
Forks0
Last update3 months ago18 Jun 2026
LicenceNone stated

Overview

H4 EMA Pullback Next Level utilizes the 200 EMA to define the primary trend and the 21 EMA to confirm momentum recovery after a pullback. The EA enters trades based on price rejection within a specific ATR-defined zone. Risk management features include percentage-based position sizing, ATR-derived stop losses, and take-profit targets tied to historical swing levels. It includes advanced filters for ADX, candle body ratio, and daily drawdown limits.

Details

Author

Mohamed-Kathree on GitHub

Type

Trading robot

Platform

MetaTrader 5 (MQL5)

Strategy

Trend following, Mean reversion

Markets

Any symbol

Timeframes

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

NameTypeDefaultDescription
RiskPercentdouble0.50Risk per trade (% of balance)
MaxLotdouble0.10Hard cap on lot size
MinLotdouble0.10Minimum lot size to trade
TFENUM_TIMEFRAMESPERIOD_H4
AtrPeriodint14
EmaFastPeriodint50
EmaSlowPeriodint200
EmaMidPeriodint21
ZoneAtrMultdouble0.40Pullback must reach EMA50 ± (ATR × mult)
SlBufferAtrdouble0.20SL placed beyond pullback extreme by (ATR × mult)
MinSlAtrdouble1.00Minimum SL distance in ATR units
UseAdxFilterboolfalse
Show all 36 inputs
NameTypeDefaultDescription
AdxPeriodint14
MinAdxdouble20.0
MaxSpreadPricedouble0.40Maximum allowable spread (price units)
MaxTradesPerDayint1Daily trade limit
MaxDailyLossPctdouble3.0Daily drawdown limit (% of start equity)
TradeStartHourint0Window open (00 = midnight)
TradeEndHourint0Window close (00 = midnight, wrap = always on)
ForceCloseAtEndboolfalseClose open position when outside window
SwingLeftint2
SwingRightint2
LevelLookbackBarsint300
MinTpAtrdouble1.2TP must be at least (ATR × mult) from entry
FallbackRRdouble3.0Fallback TP = risk × RR if no level found
StrictRiskSizingboolfalseSkip trade if raw lots < MinLot
ValidateStopsbooltrueEnforce broker stops/freeze level
LogTradeFailuresbooltruePrint failed order details
UseBodyRatioFilterboolfalse
MinBodyRatiodouble0.55Body must be ≥ 55% of candle range
UseBreakOfPreviousCandleboolfalse
BreakBufferAtrdouble0.00Extra buffer beyond H2/L2 (ATR units)
UseReclaimBufferboolfalse
ReclaimBufferAtrdouble0.10Close > EMA21 + (ATR × mult) for longs
UseEmaSlopeFilterboolfalse
EmaSlopeBarsint4Compare EMA50[1] vs EMA50[1 + bars]

How to install it

  1. 1Download the sourceUse "Download source (.zip)" above, or clone Mohamed-Kathree/H4-EMA-Pullback-Next-Level-Expert-Advisor 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

EA31337 Libre

by EA31337
252 stars

EA31337 Libre is an open-source, multi-strategy trading robot for MetaTrader 4 and MetaTrader 5. It functions as a simplified implementation of the EA31337 framework, providing a collection of over 35 built-in strategies based on technical indicators. The expert advisor performs independent market analysis across vario

MT5 Trading robot Multi-strategyTrend followingMean reversion
Updated 1 year ago GPL-3.0 GitHub repository of EA31337 Libre

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

Basic Bollinger Bands EA

by terencebeauj
21 stars

This MetaTrader 5 expert advisor utilizes the Bollinger Bands and Parabolic SAR indicators to execute trades based on market volatility. It functions as an entry-level algorithmic trading template, allowing users to modify strategy logic or optimize parameters using the MT5 Strategy Tester. The bot manages risk through

MT5 Trading robot Mean reversionTrend following

Heiken Ashi Naive

by EarnForex
17 stars

Heiken Ashi Naive is a trading robot for MetaTrader 4 and 5 that executes trades based on Heiken Ashi candle characteristics, including body length and wick presence. It evaluates candle sequences to enter positions and can be configured to either follow the trend or operate in an inverted mode for mean-reversion. Risk

MT4MT5 Trading robot Trend followingMean reversion
Updated 1 year ago Apache-2.0 GitHub repository of Heiken Ashi Naive

MonsterFX Reliable Trader

by NadirAliOfficial
12 stars

This MetaTrader 5 expert advisor combines automated Forex trading with a Discord notification system via a Python Flask webhook. It executes a dual-timeframe strategy using EMA crossovers, a 200-period trend filter, RSI, and VWAP on the M5 and M15 charts. The EA manages trades with ATR-based stop loss and take profit l

MT5 Trading robot Indicator crossoverTrend followingMean reversion

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

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