Trading robot · MT5

Multi Layer Perceptron Stat Arb

by 4SIGHTalgo

This MetaTrader 5 expert advisor utilizes a multi-layer perceptron neural network to enhance statistical arbitrage strategies.

GitHub stars1
Forks1
Last update1 year ago26 Jun 2025
LicenceNone stated

Overview

Multi Layer Perceptron Stat Arb periodically scans major currency pairs to identify high correlation relationships across multiple lookback windows. Trade signals are generated based on a confidence threshold derived from neural network scoring. The EA features risk controls including fixed lot sizing, USD-based stop loss and take profit levels, and a maximum bar-based hold time. Note that the included neural network weights are placeholders requiring external training or optimization.

Details

Author

4SIGHTalgo on GitHub

Type

Trading robot

Platform

MetaTrader 5 (MQL5)

Strategy

Arbitrage, AI / machine learning, Mean reversion

Markets

Forex

Timeframes

Any timeframe

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

NameTypeDefaultDescription
InpMinCorrelationForTradingdouble0.7Min abs correlation to consider a pair tradeable
InpScannerUpdateHoursint4How often to re-scan all pairs (in hours)
InpLookbackShortint20Short-term analysis window
InpLookbackMidint50Medium-term analysis window
InpLookbackLongint100Long-term analysis window
InpLagPeriodint4Lag for the time-lagged correlation
InpScalingLookbackint200Bars to look back for Min/Max feature scaling
InpLotSizedouble0.1Lot size for each trade
InpMagicNumberint3007Magic number for trades
InpTakeProfitUSDdouble1000Take Profit for the spread in account currency (e.g., USD)
InpStopLossUSDdouble1000Stop Loss for the spread in account currency (e.g., USD)
InpMaxHoldBarsint24000Max number of bars to hold a trade
Show all 36 inputs
NameTypeDefaultDescription
InpCorrelationExitThresholddouble0.3Exit if long-term Pearson correlation drops below this
InpMLPSignalThresholddouble1.2Confidence level to open a trade
inp_W1_11double0.0, inp_W1_12=0.0, inp_W1_13=0.0, inp_W1_14=0.0, inp_W1_15=
inp_W1_21double0.0, inp_W1_22=0.0, inp_W1_23=0.0, inp_W1_24=0.0, inp_W1_25=
inp_W1_31double0.0, inp_W1_32=0.0, inp_W1_33=0.0, inp_W1_34=0.0, inp_W1_35=
inp_W1_41double0.0, inp_W1_42=0.0, inp_W1_43=0.0, inp_W1_44=0.0, inp_W1_45=
inp_W1_51double0.0, inp_W1_52=0.0, inp_W1_53=0.0, inp_W1_54=0.0, inp_W1_55=
inp_W1_61double0.0, inp_W1_62=0.0, inp_W1_63=0.0, inp_W1_64=0.0, inp_W1_65=
inp_b1_1double-0.4, inp_b1_2= 0.7, inp_b1_3=-0.9, inp_b1_4= 0.6, inp_b1_5=
inp_W2_11double0.0, inp_W2_12=0.0, inp_W2_13=0.0, inp_W2_14=0.0, inp_W2_15=
inp_W2_21double0.0, inp_W2_22=0.0, inp_W2_23=0.0, inp_W2_24=0.0, inp_W2_25=
inp_W2_31double0.0, inp_W2_32=0.0, inp_W2_33=0.0, inp_W2_34=0.0, inp_W2_35=
inp_W2_41double0.0, inp_W2_42=0.0, inp_W2_43=0.0, inp_W2_44=0.0, inp_W2_45=
inp_W2_51double0.0, inp_W2_52=0.0, inp_W2_53=0.0, inp_W2_54=0.0, inp_W2_55=
inp_W2_61double0.0, inp_W2_62=0.0, inp_W2_63=0.0, inp_W2_64=0.0, inp_W2_65=
inp_W2_71double0.0, inp_W2_72=0.0, inp_W2_73=0.0, inp_W2_74=0.0, inp_W2_75=
inp_W2_81double0.0, inp_W2_82=0.0, inp_W2_83=0.0, inp_W2_84=0.0, inp_W2_85=
inp_b2_1double-1.0, inp_b2_2= 0.2, inp_b2_3= 0.9, inp_b2_4=-0.7, inp_b2_5=
inp_W3_11double0.0, inp_W3_12=0.0, inp_W3_13=0.0
inp_W3_21double0.0, inp_W3_22=0.0, inp_W3_23=0.0
inp_W3_31double0.0, inp_W3_32=0.0, inp_W3_33=0.0
inp_W3_41double0.0, inp_W3_42=0.0, inp_W3_43=0.0
inp_W3_51double0.0, inp_W3_52=0.0, inp_W3_53=0.0
inp_b3_1double0.8, inp_b3_2=-0.6, inp_b3_3= 0.8

How to install it

  1. 1Download the sourceUse "Download source (.zip)" above, or clone 4SIGHTalgo/MQL5-Mutli-Layer-Perception 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

9 stars

This MetaTrader 5 expert advisor executes a counter-trend strategy utilizing Bollinger Bands and the Slow Stochastic oscillator. Developed as part of academic research into deep learning and technical analysis, the robot incorporates Heiken Ashi filtering to identify market extensions and doji candles. It manages risk

MT5 Trading robot Mean reversionAI / machine learning
6 stars

This MetaTrader 5 expert advisor provides a versatile framework for trading based on Heiken Ashi price action. It allows users to toggle between numerous built-in strategies, including trend following, moving average crossovers, Fibonacci levels, and various oscillators like RSI and MACD. The system includes an option

MT5 Trading robot Trend followingIndicator crossoverMean reversion
Updated 2 years ago None stated GitHub repository of Heiken Ashi Complete Strats
3 stars

This expert advisor facilitates arbitrage trading between futures and spot instruments, primarily targeting gold and stock indices. Available for MetaTrader 4 and 5, it monitors the price difference between two related symbols against a moving average to identify trade opportunities. The logic includes a noise-filterin

MT4MT5 Trading robot ArbitrageMean reversionGrid High risk
Updated 3 years ago None stated GitHub repository of Gold Futures Spot Arbitrage
2 stars

This MetaTrader 5 expert advisor implements a trade execution strategy based on a linear regression model. It calculates entries using specific coefficients for an intercept and five independent variables, which include volatility, relative strength index, and average directional index data. The bot supports intraday o

MT5 Trading robot AI / machine learningMean reversion

The AI Quantum Learning Advanced Trailing Stop EA is an automated trading robot for MetaTrader 5 that employs neural network structures and quantum probability calculations. It monitors market patterns by analyzing price changes, volume, volatility, and indicators like RSI. The EA manages risk using fixed stop loss and

MT5 Trading robot AI / machine learningMean reversion
1 stars

LQS AI Institutional Engine is a MetaTrader 5 robot designed for trading gold using market microstructure analysis. It combines four analytical modules focusing on liquidity sweeps, order flow divergence, Wyckoff accumulation and distribution phases, and multiple anchored VWAP levels. The system features an integrated

MT5 Trading robot SMC / ICT / price actionAI / machine learningMean reversion High risk
Updated 4 months ago None stated GitHub repository of Lqs Ai Institutional Engine

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