Trading robot · MT5

MADR Brothers

by mitsuaki-41

MADR Brothers is a MetaTrader 5 expert advisor that utilizes multi-timeframe Moving Average Deviation Rates to identify trading opportunities.

High risk

GitHub stars1
Forks0
Last update3 months ago26 May 2026
LicenceMIT

Overview

MADR Brothers filters market trends using a long-period MADR on higher timeframes while entering trades based on overbought or oversold levels of a shorter-period MADR. The system includes risk management features such as equity-based lot sizing, optional percentage-based stop loss and take profit, and a volume ratio momentum filter. It offers optional grid and martingale modes for recovery, alongside customizable trend-following or mean-reversion configurations.

Details

Author

mitsuaki-41 on GitHub

Type

Trading robot

Platform

MetaTrader 5 (MQL5)

Strategy

Trend following, Mean reversion, Grid, Martingale

Markets

Any symbol

Timeframes

Any timeframe

Risk profile

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

Input parameters

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

NameTypeDefaultDescription
MagicNumberulong123456Magic Number
TrendFollowingbooltrueTrend Following (Long MADR)
InitialTrendTrend10Initial Trend Signal
InitializeSignalboolfalseOff Trend Signal at Range Area
FixTrendTrend20Fix Trend Signal
longMaTimeframeENUM_TIMEFRAMESPERIOD_D1Long MADR Timeframe
InpLongMaPeriodint5Long MADR Period
InpLongMaDevThresholdBulldouble0.31Bullish Signal Threshold by Long MADR
InpLongMaDevThresholdBeardouble-0.31Bearish Signal Threshold by Long MADR
ignoreLongMaDevSigboolfalseIgnore Trend Signal
InpMaPeriodint12MADR period
InpMaDevThresholdBoughtdouble0.31MADR OverBought Threshold
Show all 37 inputs
NameTypeDefaultDescription
InpMaDevThresholdSolddouble-0.31MADR OverSold Threshold
InpPeriodVRint144Volume Ratio Period
InpThresholdVRdouble1.618Required Volume Ratio Threshold (0: Off)
InpRequiredBarsint0Required Consecutive Bar Count (0: Off)
InpIdioticalModeboolfalseIdiotical Mode (Reverse Order Side)
idioticalAlternationboolfalseTurn on Idiotical Mode by Odd Loss Count
DontOpenAfter_SLTPbooltrueDon't Open After SL/TP until Next Bar
LotCoefficientdouble0.0001Lot Coefficient Value (Based on Equity)
MaxLossCountint2Max Loss Count (0: Disable Lot Multiplier)
initialLossCountint1Initial Loss Count
LotMultiplierdouble0.786Lot Multiplier after Loss Trading
MaxLotDenominatorint1Denominator Max First Lot
GridSwitchboolfalseEnable Grid
GridDistancedouble0.31Grid Distance Percentage
GridMultiplierdouble1.618Multiplier Each Grid Distance
GridLotMultiplierdouble0.618Grid Order Lot Multiplier (0: Off)
TakeProfitPercentagedouble0Take Profit Percentage (0: Off)
StopLossPercentagedouble0Stop Loss Percentage (0: Off)
LossToRangeFactordouble1.0Loss to SL/TP Range Factor (1.0: Off)
CloseWithMaDevbooltrueClose with Current MADR
closeMaDevThresholdBoughtdouble-0.2Current MADR Close Bought Threshold
closeMaDevThresholdSolddouble0.2Current MADR Close Sold Threshold
DebugModeboolfalseDebug Mode
StopEA_MarginLeveldouble25Debug Mode EA Stop Margin Level Percentage
CommentSwitchbooltrueComment On / Off

How to install it

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

IchiDCA CCBSN PropFirm EA

by magicniuniu
3 stars

IchiDCA CCBSN PropFirm EA is an automated trend-following robot for MetaTrader 5, optimized for gold and forex markets. It triggers trades based on Ichimoku Cloud breaks, filtered by dual Exponential Moving Averages and MACD indicators. The strategy manages positions through a Dollar Cost Averaging system that layers u

MT5 Trading robot Trend followingGridMean reversion High risk

Se-0303

by se333
1 stars

Se-0303 is an automated trading robot for MetaTrader 4 and 5 that employs a grid-based approach with Martingale lot scaling. It determines entries through trend analysis and M1 fractals, using coefficients to calculate order distances and take profit targets relative to price height. The EA includes specific risk contr

MT4MT5 Trading robot GridMartingaleTrend following High risk
Updated 6 years ago None stated GitHub repository of Se-0303
1 stars

This Expert Advisor for MetaTrader 5 focuses on gold trading through a combination of mean-reversion signals and a grid management system. It uses multi-timeframe filters, including exponential moving averages and ADX on the H1 timeframe, to identify trend direction while executing entries on M15 based on RSI and Bolli

MT5 Trading robot Mean reversionGridMartingale High risk

RSI Martingale EA

by peefpee
10 stars

This Expert Advisor for MetaTrader 5 implements a martingale trading strategy triggered by the Relative Strength Index (RSI). It opens an initial position when RSI reaches overbought or oversold thresholds. If price continues to move against the initial trade, the EA layers additional orders at set point intervals, mul

MT5 Trading robot MartingaleMean reversionGrid High risk

Smart Grid Martingale EA

by chenhengyi53-design
9 stars

This MetaTrader 5 expert advisor executes a grid trading strategy enhanced with martingale lot scaling. The system identifies market direction through multi-timeframe analysis using Exponential Moving Averages and the Average Directional Index. It features dynamic grid spacing that adjusts based on market volatility an

MT5 Trading robot GridMartingaleTrend following High risk
Updated 7 months ago None stated GitHub repository of Smart Grid Martingale EA
7 stars

This MetaTrader 5 expert advisor executes a mean reversion strategy based on price deviation from a Simple Moving Average. It enters short positions when prices rise above the average and long positions when prices fall below. The algorithm utilizes an aggressive grid-based recovery system where both the entry distance

MT5 Trading robot Mean reversionMartingaleGrid High risk

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