DBasket EA identifies price divergences between related currency pairs using Z-score analysis and enters hedged three-leg positions expecting mean reversion. The system incorporates advanced statistical modules including an Augmented Dickey-Fuller cointegration filter and Ornstein-Uhlenbeck half-life calculations for exit timing. Risk controls feature fixed or ATR-weighted lot sizing, basket-level stop losses and take profits, maximum drawdown protection, and daily loss limits. It requires a hedging-enabled account and specific symbol sets like AUDNZD, AUDCAD, and NZDCAD.
Read from DBasketEA_v2.mq5. Defaults are the author's; change them in the EA's Inputs tab.
Name
Type
Default
Description
InpSymbolSuffix
string
Symbol suffix (e.g., ".m", "_sb")
InpLookbackPeriod
int
250
Lookback period (bars)
InpCacheUpdateSec
int
30
Cache update interval (seconds)
InpZScoreEntry
double
2.5
Entry Z-Score threshold
InpZScoreExit
double
0.5
Exit Z-Score threshold
InpMinCorrelation
double
0.75
Minimum correlation threshold
InpMaxSpreadPips
double
3.0
Maximum spread (pips per symbol)
InpFixedLotSize
double
0.01
Fixed lot size per leg
InpRiskPercent
double
1.0
Risk % per basket (if dynamic sizing)
InpUseFixedLots
bool
true
Use fixed lot size
InpMaxDrawdownPct
double
15.0
Max drawdown % before halt
InpDailyLossLimit
double
100.0
Daily loss limit ($)
Show all 39 inputs
Name
Type
Default
Description
InpDailyLossPct
double
5.0
Daily loss limit (%)
InpMaxHoldingHours
int
24
Maximum basket holding hours
InpTakeProfitAmount
double
10.0
Take profit per basket ($)
InpStopLossAmount
double
15.0
Stop loss per basket ($)
InpCointEnabled
bool
true
Enable Cointegration Filter?
InpCointPValue
double
0.05
P-Value Threshold (0.01-0.10)
InpCointUpdateBars
int
50
Update Interval (bars)
InpCointADFLags
int
1
ADF Regression Lags
InpHLEnabled
bool
true
Enable Half-Life Exits?
InpHLUpdateBars
int
20
Update Interval (bars)
InpHLMinValue
int
10
Minimum Half-Life (bars)
InpHLMaxValue
int
500
Maximum Half-Life (bars)
InpHLExitMultiplier
double
2.0
Max Hold = Multiplier × HalfLife
InpHLStopLossSigma
double
1.5
Stop-Loss Distance (sigma)
InpATREnabled
bool
true
Enable ATR Sizing?
InpATRPeriod
int
14
ATR Period
InpATRMinWeight
double
0.15
Minimum Weight per Symbol
InpATRMaxWeight
double
0.50
Maximum Weight per Symbol
InpTradingStartHour
int
0
Trading start hour (broker time)
InpTradingStartMin
int
0
Trading start minute
InpTradingEndHour
int
23
Trading end hour (broker time)
InpTradingEndMin
int
59
Trading end minute
InpAvoidRollover
bool
true
Avoid rollover period
InpMagicNumber
int
200000
Magic number (v2.0)
InpSlippagePoints
int
10
Maximum slippage (points)
InpLogLevel
ENUM_LOG_LEVEL
LOG_LEVEL_INFO
Log level
InpLogToFile
bool
false
Log to file
How to install it
1Download the sourceUse "Download source (.zip)" above, or clone dinethlive/dbasket-EA from GitHub, and unzip it.
2Open the data folderIn MetaTrader choose File, then Open Data Folder, and go to MQL5/Experts.
3Copy the filesCopy the .mq5 file into Experts, and any .mqh files into the Include folder the code expects.
4Compile in MetaEditorOpen the file in MetaEditor and press Compile. Fix any missing includes the compiler reports.
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.
High Frequency Grid EA is an automated trading robot for MetaTrader 5 that implements a mean-reversion strategy through a grid of pending orders. It places buy and sell stop orders at calculated distances, using dynamic spread monitoring to ensure execution only during favorable conditions. The EA includes a trailing s
This MetaTrader 5 expert advisor implements a mean-reversion strategy primarily designed for the EUR/USD pair. It utilizes a 25-period Moving Average to identify price deviations, operating on the theory that hourly prices will eventually return to the mean. The code facilitates a dual-position approach, managing simul
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
This MetaTrader 5 expert advisor functions as a grid-based recovery system that can operate independently or manage trades from external EAs via magic number filtering. It initiates entries using Bollinger Bands and RSI indicators, then manages drawdown through a recovery grid matrix. The system employs dynamic ATR-bas
Advanced Grid Trading is a MetaTrader 5 expert advisor that manages a complex grid strategy across four configurable layers. It places stop and limit orders at fixed intervals, employing either fixed or geometric lot scaling for increased grid depth. Trade management includes a shared profit pool used to close losing p
This MetaTrader 5 expert advisor implements a multi-layered grid strategy that manages up to three independent grids simultaneously on a single instrument. It uses the Relative Strength Index (RSI) across different timeframes to determine the initial trade direction for each grid. The EA employs martingale lot scaling,