Trading robot · MT4 · MT5

EA PM Portfolio Management

by JuanPabloMF

This automated expert advisor for MetaTrader 4 and 5 trades forex using a multi-timeframe technical strategy.

High risk

GitHub stars1
Forks0
Last update7 weeks ago29 Jul 2026
LicenceNone stated

Overview

EA PM Portfolio Management identifies H1 trends with moving averages and Ichimoku clouds while timing M5 entries via MACD and RSI convergence. The system incorporates robust risk controls including equity-based lot sizing, daily loss limits, and tiered drawdown circuit breakers. Trade management features automated breakeven adjustments, partial profit booking, and trailing stops. It uniquely integrates an external Python-based news analyzer to avoid high-volatility events. The EA monitors portfolio exposure by limiting concurrent trades and currency-specific direction.

Details

Author

JuanPabloMF on GitHub

Type

Trading robot

Platform

MetaTrader 4 (MQL4) and MetaTrader 5 (MQL5)

Strategy

Trend following, Indicator crossover, Multi-strategy, Martingale

Markets

Forex

Timeframes

M1-M5, M15-H1

Risk profile

  • Uses martingale lot scaling: losses can grow fast

Input parameters

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

NameTypeDefaultDescription
InpSymbolsstringEURUSD,GBPUSD,USDJPY,USDCHF,AUDUSD,USDCADSymbols to trade
InpRiskPercentdouble0.5Risk per trade (%)
InpMaxSpreaddouble20Maximum spread (points)
InpMaxSlippageint10Maximum slippage (points)
InpMagicBaselong202601Magic number base
InpDDSoftdouble4.0Soft drawdown limit (%) - blocks new entries
InpDDHarddouble5.0Hard drawdown limit (%) - flatten and halt
InpMaxDailyLossdouble2.0Max daily loss (%) - blocks entries until next day
InpProfitTargetPctdouble10.0Halt after reaching this gain (%) (0 = off)
InpMaxOpenPositionsint3Max simultaneous positions (all symbols)
InpMaxPerCurrencySideint2Max positions sharing one currency direction
InpSL_ATRdouble1.5Stop Loss (ATR multiplier)
Show all 33 inputs
NameTypeDefaultDescription
InpTP_ATRdouble3.0Take Profit (ATR multiplier)
InpBE_ATRdouble1.0Breakeven (ATR multiplier)
InpMinSL_Pipsdouble5.0Minimum SL distance (pips)
InpMaxLotsdouble5.0Hard cap on position size (lots)
InpEMA_Fastint20EMA Fast period
InpEMA_Slowint50EMA Slow period
InpRSI_Periodint14RSI period
InpMACD_Fastint12MACD Fast period
InpMACD_Slowint26MACD Slow period
InpMACD_Signalint9MACD Signal period
InpATR_Periodint14ATR period
InpSwingLookbackint5Swing lookback bars
InpMinConvergenceint3Minimum convergence signals
InpMinADX_H1double0Min H1 ADX to trade (0 = off, try 20-25)
InpWeekOpenCooldownMinint120Minutes after weekly open with no entries
InpMaxTradesint3Max trades per day
InpMaxLossesint2Max consecutive losses
InpPauseMinutesint30Pause after loss (minutes)
InpNewsFilestringnews_risk.jsonNews risk file
InpNewsPauseint30News pause (minutes)
InpShowDashboardbooltrueShow dashboard panel

How to install it

  1. 1Download the sourceUse "Download source (.zip)" above, or clone JuanPabloMF/pm-trading from GitHub, and unzip it.
  2. 2Open the data folderIn MetaTrader choose File, then Open Data Folder, and go to MQL4/Experts or MQL5/Experts.
  3. 3Copy the filesCopy the .mq4 / .mq5 file into Experts, and any .mqh files into the Include folder the code expects.
  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

Forex Brother Algo 1

by hkmarquix
1 stars

This MetaTrader 4 expert advisor implements a multi-strategy framework for automated trading across various symbols. It incorporates several technical entry signals, including Ichimoku, Bollinger Bands, and ADX-filtered logic. The EA provides multiple trade management options, explicitly including martingale lot scalin

MT4 Trading robot Multi-strategyMartingaleIndicator crossover High risk
Updated 5 years ago None stated GitHub repository of Forex Brother Algo 1

EA31337

by EA31337
1.3k stars

EA31337 is a comprehensive multi-strategy trading robot and framework for MetaTrader platforms. It features dozens of pre-built strategies utilizing technical indicators like ATR, Moving Averages, and SuperTrend. The system manages entries and exits through a unique filtering system that monitors account metrics, volat

MT5 Trading robot Multi-strategyNewsTrend following
Updated 5 months ago GPL-3.0 GitHub repository of EA31337

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

EA Scalper XAUUSD

by francomascareloai
236 stars

EA Scalper XAUUSD is an automated trading research project for MetaTrader 5 focused on gold. It employs a multifaceted entry strategy using Smart Money Concepts like order blocks and liquidity sweeps, alongside moving average crossovers and Fibonacci zones. The EA includes a self-learning module designed to adapt to di

MT5 Trading robot SMC / ICT / price actionIndicator crossoverScalping High risk
Updated 3 months ago Custom licence GitHub repository of EA Scalper XAUUSD

ADX Cross EA

by chaipat-ncm
143 stars

This MetaTrader 4 expert advisor functions as an automated trading robot using the Average Directional Index (ADX) to identify trend strength and direction. It executes trades based on ADX crossovers and specific level thresholds. The EA provides essential risk management tools, including stop loss, take profit, and a

MT4 Trading robot Indicator crossoverMartingaleTrend following High risk
Updated 2 years ago None stated GitHub repository of ADX Cross EA

Gold Trader EA

by mehdi-jahani
141 stars

Gold Trader EA is a multi-strategy expert advisor designed for trading XAUUSD on the MetaTrader 5 platform. It employs a fusion engine that combines up to 14 different technical analysis methods, including candlestick patterns, chart patterns, price action, and institutional levels. The system requires a user-defined n

MT5 Trading robot Multi-strategyTrend followingIndicator crossover
Updated 1 year ago None stated GitHub repository of Gold Trader EA

More trading robots

Need a broker for MT4/MT5?

Compare regulated brokers that support MetaTrader, with spreads, minimum deposits and leverage side by side.

Compare brokers