Pipsgrowth EX12072 MultiIndicatorConfluence
MT5 Expert Advisor (Open Source) · XAUUSD · M5
Pipsgrowth.com EX12072 MultiStrategyEA_v1_2 — Multi-strategy EA (AC+ADX+AO+DeM+FBB+MFI+MS), full 12-layer stack.
Overview
EX12072 is a multi-strategy composite — not one indicator or one vote, but seven independent trading sub-strategies running in parallel, each with its own indicator, its own order book, its own TP/SL, and its own recovery lot sizing. Toggle any of them off with the per-strategy *_StrategyRun switch (default: all on), or run them in mutual-exclusion mode via TradeAllStrategies = false, in which case only one strategy is allowed to have open positions at a time and whichever sub-strategy fires first takes the slot until it closes.
The seven sub-strategies are: AC (Accelerator Oscillator via iAC), ADX (iADX(20) on the configured bar period), AO (Awesome Oscillator via iAO), DeM (iDeMarker(20)), FBB (Bollinger Bands iBands(20, 0, 1.8, PRICE_CLOSE) AND-combined with the Force Index iForce(20, MODE_SMA, VOLUME_TICK)), MFI (iMFI(12, VOLUME_TICK)), and MS (MACD iMACD(3, 9, 2, PRICE_CLOSE) AND-combined with Stochastic iStochastic(5, 3, 12, MODE_SMA, STO_LOWHIGH)). Each sub-strategy instantiates its own indicator handle in OnInit() and releases it in OnDeinit() — nine handles total when all sub-strategies are on. The MACD/MS combination is a deliberate MACD-cross + Stochastic-confirmation pattern, not a single MACD line, which is the structural reason MS is the only sub-strategy that needs 11+28 signal pattern numbers (1-11 for the MACD leg, 1-28 for the Stochastic leg).
The signal pattern is the heart of the design. Rather than locking each sub-strategy to one crossover formula, the source encodes 8 (or 4 or 11/28) discrete pattern switches per indicator, each representing a different combination of (a) where the current bar's indicator value sits relative to a user-defined level, (b) where the previous bar's value sat, and (c) the direction of the move. For AC with the defaults — AC_OpenOrdersType = 5 and AC_LevelOpenOrders = 80.0 — the buy trigger fires when both the current and previous AC value are below the negated level −80.0 AND the current value is below the previous one (AC is a momentum oscillator: deeply negative and falling further = acceleration down, which the strategy treats as a contrarian buy). The 8 patterns let you pick the exact flavor of mean-reversion vs. trend-following vs. breakout you want from each indicator without recompiling. The MS sub-strategy's MS_OpenOrdersType_1 = 8 and MS_OpenOrdersType_2 = 22 with levels 60.0 and 80.0 are the analogous pick for the MACD-then-Stochastic AND-chain.
The per-strategy AND-combination in FBB and MS is the one structural feature that distinguishes them from the others. FBB's FBB_OpenBuy_1 (Bollinger band touch: PriceHigh < LowerBandValue_1) is gated by a band-distance check DistanceBands > FBB_LevelOpenOrders_1 so the band-touch only counts when the bands are wide enough, and FBB only fires the buy if BOTH FBB_OpenBuy_1 == true AND FBB_OpenBuy_2 == true (Force Index pattern). MS uses the same AND gate on its MACD and Stochastic legs. AC/ADX/AO/DeM/MFI each produce a single open/close signal per side, so no AND-chain there.
Order management is also per-strategy and almost fully decoupled. Each sub-strategy has its own *_TakeProfit and *_StopLoss defaults: AC 95/85, ADX 35/70, AO 10/80, DeM 5/60, FBB 5/15, MFI 50/25, MS 10/45. The *_TypeOfLevelsUse enum (default Use_Only_Virtual_Levels for all) lets you choose between hard SL/TP on the order ticket, virtual (EA-managed) levels, or both — virtual levels mean the SL/TP are tracked inside the EA rather than sent to the broker, which keeps the order's visible SL/TP empty in the trade tab. *_AutoLotSize = true (default for all) plus *_RiskFactor = 1.0 and *_ManualLotSize = 0.10 are the lot-sizing inputs per strategy; when AutoLotSize is off, the manual lot is used. The *_UseRecoveryLot enum (Not_Use_Recovery / Use_Last_Closing / Use_Higher_Profits) with *_MultiRecoveryLot = 2.0 defines how the EA sizes the next order after a closed loss — either not at all, matching the previous closed lot, or scaling to the highest historical profit-closing lot.
The grid layer is a separate global switch (MakeOrdersGrid with values Not_Make_Grid / Make_Grid_In_Loss / Make_Grid_In_Profit / Make_Grid_Loss_And_Profit, plus PipsBetweenOrders and TimeBetweenOrders = 60 seconds). When grid is off (the default) only one order per side per sub-strategy is allowed. When Make_Grid_In_Loss is on, the EA will stack additional orders in the same direction if price moves against the open position by PipsBetweenOrders (or in the favorable direction, when grid-in-profit is on), provided the cool-down TimeBetweenOrders has elapsed. Each sub-strategy's grid uses its own price-water tracking variables (*_PriceOpenHigherBuy, *_PriceOpenLowerBuy, *_PriceOpenHigherSell, *_PriceOpenLowerSell).
The trade-flow runtime is in OnTick(): reset all 28 per-sub-strategy signal flags → call each enabled sub-strategy's *_GetSignals() once per new bar (the LastTimeRunFunctions gate ensures signals are evaluated on closed bars, not every tick) → call MainFunction() which checks market-open via SymbolInfoSessionTrade, computes spread, applies the MaxSpread filter, honors the TypeOperation mode (Stand by / Normal / Close Immediately), and applies the ControlSession Monday-open wait and Friday-close stop. Then it walks each sub-strategy and either closes its open positions on *_CloseBuy/*_CloseSell signals (with CloseInReverse = true flipping the close flag on any opposite open signal — long signal closes shorts) or opens new positions when the per-strategy AND-chain is satisfied and SumOrders < MaxOrders (or MaxOrders == 0).
There is no global drawdown cap input on this EA — the only * strategy-level recovery. MaxOrders (default 0 = unlimited) and MaxSpread (default 0 = no limit) are the two global safety knobs. Slippage = 3 is the standard MT5 slippage. The retry helpers TryClose_EX12072, TryClosePartial_EX12072, and TryModify_EX12072 (three attempts on REQUOTE / TIMEOUT / PRICE_OFF / PRICE_CHANGED) are defined but, looking at MainFunction(), are not actually wired into the live close/modify calls — m_trade is used directly.
For backtesting, run it on the chart's broker with MaxSpread set to a realistic cap (e.g. 30-50 for XAUUSD, or 5-10 for major FX) because the default 0 means every quote is accepted, including rollover spikes. The seven sub-strategies create seven independent order books under magic 22212072 with sub-IDs; in a multi-pair setup with PairToTrade set to anything other than CHART_PAIR, attach the EA to one chart and it will route orders to the selected symbol. Expect most fills to come from the AO and MFI sub-strategies at the default levels (10 pips TP / 90 MFI threshold) and the FBB sub-strategy to be the quietest because it requires both the band-distance and Force Index conditions to align.
Strategy Deep Dive
EX12072 instantiates nine indicator handles in OnInit — iAC, iADX(20), iAO, iDeMarker(20), iBands(20,0,1.8,PRICE_CLOSE), iForce(20,MODE_SMA,VOLUME_TICK), iMFI(12,VOLUME_TICK), iMACD(3,9,2,PRICE_CLOSE), iStochastic(5,3,12,MODE_SMA,STO_LOWHIGH) — and releases them all in OnDeinit. OnTick waits for a new bar (the LastTimeRunFunctions guard) before calling each enabled *_GetSignals() function, then MainFunction checks market-open via SymbolInfoSessionTrade, spread against MaxSpread, the TypeOperation mode, and the Monday/Friday session gate before walking the seven sub-strategies to either close reverse-signal positions or open new ones. The 8-pattern signal switch per indicator (4 for ADX/DeM/MFI, 11+28 for MS) lets the user pick a specific flavor of mean-reversion, breakout, or trend-following per oscillator without touching code.
Each of the seven sub-strategies (AC, ADX, AO, DeM, FBB+Force, MFI, MACD+Stochastic) computes its own buy/sell flag from an 8-pattern (or 4/11/28) signal switch against a user-defined level. FBB and MS additionally require both legs of their dual-indicator pair to align (AND gate). Sub-strategies only fire when TradeAllStrategies is true OR no other sub-strategy currently has open positions.
Per-strategy TP/SL (defaults span 5-95 pips TP and 15-85 pips SL). The *_CloseInSignals flag closes the sub-strategy's book on its own reverse signal; CloseInReverse = true (global) also closes opposite positions when any open signal fires. Virtual SL/TP via *_TypeOfLevelsUse = Use_Only_Virtual_Levels (default) is EA-tracked, not broker-side.
Each sub-strategy has its own hard-coded pips SL applied at order open: AC 85, ADX 70, AO 80, DeM 60, FBB 15, MFI 25, MS 45. The global MaxSpread filter blocks entry on wide quotes; MaxOrders (0=unlimited) caps the total book. No global drawdown cap input — recovery is per-strategy via *_UseRecoveryLot.
Each sub-strategy carries its own TP: AC 95, ADX 35, AO 10, DeM 5, FBB 5, MFI 50, MS 10 pips. *_TypeOfLevelsUse = Use_Only_Virtual_Levels means these targets are tracked in-EA; switching to Use_Only_Hard_Levels puts them on the broker ticket.
XAUUSD on M5 with an ECN/RAW-spread broker. The seven sub-strategies will fire across multiple sessions, so an account with a $100 minimum (matching the default *_ManualLotSize = 0.10 and *_RiskFactor = 1.0 per strategy) needs a broker with low overnight swap and tight gold spreads (<30 points typical). Set MaxSpread to 30-50 before live use; default 0 will accept rollover spikes.
Strategy Logic
Pipsgrowth EX12072 MultiIndicatorConfluence — Strategy Logic Analysis (from .mq5 source)
Family: MultiIndicatorConfluence
Magic: 22212072
Version: 2.00
BRIEF:
Multi-strategy EA combining AC, ADX, AO, DeM, FBB, MFI and MS indicators with grid orders, recovery lot sizing, session control and multi-pair trading support. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
MainFunction()OpenOrders()CloseOrders()GetResultsCurrentOrders()GetResultsHistoryOrders()CalcLots()DrawObjects()DisplayText()CommentScreen()AC_GetSignals()ADX_GetSignals()AO_GetSignals()- ...and 7 more
INTERNAL CONSTANTS (1 total):
MagicSet=22212072// ============================================================================================================================================================================================================================//
INPUT PARAMETERS (145 total across 47 groups):
- [===
OPERATIONSETTINGS===]TypeOperation= Normal_Operation // Type Of Operation - [===
CHART&SYMBOLSETTINGS===]SetChartUses=true// Set Automatically Chart To Use - [===
CHART&SYMBOLSETTINGS===]PairToTrade=TRADE_EURUSD_4// Symbol Expert Trade - [===
GENERALTRADINGSETTINGS===]TimeFrame= 8 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)//Period Of Bars - [===
GENERALTRADINGSETTINGS===]CloseInReverse=true// Close Orders In Reverse Signal - [===
GENERALTRADINGSETTINGS===]TradeAllStrategies=true// Trade All Strategies Together - [=== AC
STRATEGY===] AC_StrategyRun =true// AC Strategy Run - [=== AC Signal Parameters ===] AC_OpenOrdersType = 5 // AC Type Of Open
Orders(0=Not Use)(from 1 to 8) - [=== AC Signal Parameters ===] AC_LevelOpenOrders =
80.0// AC Level Open Orders - [=== AC Signal Parameters ===] AC_CloseInSignals =
true// AC Close Orders With Signals - [=== AC Signal Parameters ===] AC_CloseOrdersType = 1 // AC Type Of Close
Orders(0=Not Use)(from 1 to 8) - [=== AC Signal Parameters ===] AC_LevelCloseOrders =
70.0// AC Level Close Orders - [=== AC Order Management ===] AC_TypeOfLevelsUse = Use_Only_Virtual_Levels // AC Type Of Levels Use To Close Orders
- [=== AC Order Management ===] AC_TakeProfit =
95.0// AC Pips TakeProfit(0=Not Use) - [=== AC Order Management ===] AC_StopLoss =
85.0// AC Pips StopLoss(0=Not Use) - [=== AC Money Management ===] AC_AutoLotSize =
true// AC Auto Money Management - [=== AC Money Management ===] AC_RiskFactor =
1.0// AC Risk Money Management - [=== AC Money Management ===] AC_ManualLotSize =
0.10// AC Manual Lot Size - [=== AC Recovery Settings ===] AC_UseRecoveryLot = Not_Use_Recovery // AC Use Recovery Lot Size After Losses
- [=== AC Recovery Settings ===] AC_MultiRecoveryLot =
2.0// AC Multiplier For Recovery Lot Size - [===
ADXSTRATEGY===] ADX_StrategyRun =true//ADXStrategy Run - [===
ADXIndicator Parameters ===] ADX_BarsCalculate = 20 //ADXBars Calculate Signals - [===
ADXSignal Parameters ===] ADX_OpenOrdersType = 2 //ADXType Of OpenOrders(0=Not Use)(from 1 to 4) - [===
ADXSignal Parameters ===] ADX_LevelOpenOrders_1 =55.0//ADXLevel Open Orders 1 - [===
ADXSignal Parameters ===] ADX_LevelOpenOrders_2 =15.0//ADXLevel Open Orders 2 - [===
ADXSignal Parameters ===] ADX_CloseInSignals =true//ADXClose Orders With Signals - [===
ADXSignal Parameters ===] ADX_CloseOrdersType = 4 //ADXType Of CloseOrders(0=Not Use)(from 1 to 4) - [===
ADXSignal Parameters ===] ADX_LevelCloseOrders_1 =15.0//ADXLevel Close Orders 1 - [===
ADXSignal Parameters ===] ADX_LevelCloseOrders_2 =5.0//ADXLevel Close Orders 2 - [===
ADXOrder Management ===] ADX_TypeOfLevelsUse = Use_Only_Virtual_Levels //ADXType Of Levels Use To Close Orders - [===
ADXOrder Management ===] ADX_TakeProfit =35.0//ADXPips TakeProfit(0=Not Use) - [===
ADXOrder Management ===] ADX_StopLoss =70.0//ADXPips StopLoss(0=Not Use) - [===
ADXMoney Management ===] ADX_AutoLotSize =true//ADXAuto Money Management - [===
ADXMoney Management ===] ADX_RiskFactor =1.0//ADXRisk Money Management - [===
ADXMoney Management ===] ADX_ManualLotSize =0.10//ADXManual Lot Size - [===
ADXRecovery Settings ===] ADX_UseRecoveryLot = Not_Use_Recovery //ADXUse Recovery Lot Size After Losses - [===
ADXRecovery Settings ===] ADX_MultiRecoveryLot =2.0//ADXMultiplier For Recovery Lot Size - [=== AO
STRATEGY===] AO_StrategyRun =true// AO Strategy Run - [=== AO Signal Parameters ===] AO_OpenOrdersType = 6 // AO Type Of Open
Orders(0=Not Use)(from 1 to 8) - [=== AO Signal Parameters ===] AO_LevelOpenOrders =
55.0// AO Level Open Orders - [=== AO Signal Parameters ===] AO_CloseInSignals =
true// AO Close Orders Via Signals - [=== AO Signal Parameters ===] AO_CloseOrdersType = 8 // AO Type Of Close
Orders(0=Not Use)(from 1 to 8) - [=== AO Signal Parameters ===] AO_LevelCloseOrders =
40.0// AO Level Close Orders - [=== AO Order Management ===] AO_TypeOfLevelsUse = Use_Only_Virtual_Levels // AO Type Of Levels Use To Close Orders
- [=== AO Order Management ===] AO_TakeProfit =
10.0// AO Pips TakeProfit(0=Not Use) - [=== AO Order Management ===] AO_StopLoss =
80.0// AO Pips StopLoss(0=Not Use) - [=== AO Money Management ===] AO_AutoLotSize =
true// AO Auto Money Management - [=== AO Money Management ===] AO_RiskFactor =
1.0// AO Risk Money Management - [=== AO Money Management ===] AO_ManualLotSize =
0.10// AO Manual Lot Size - [=== AO Recovery Settings ===] AO_UseRecoveryLot = Not_Use_Recovery // AO Use Recovery Lot Size After Losses
- [=== AO Recovery Settings ===] AO_MultiRecoveryLot =
2.0// AO Multiplier For Recovery Lot Size - [===
DEMSTRATEGY===]DeM_StrategyRun=true//DeMStrategy Run - [===
DeMIndicator Parameters ===]DeM_BarsCalculate= 20 //DeM_Bars Calculate Signals - [===
DeMSignal Parameters ===]DeM_OpenOrdersType= 3 //DeMType Of OpenOrders(0=Not Use)(from 1 to 4) - [===
DeMSignal Parameters ===]DeM_LevelOpenOrders=75.0//DeMLevel Open Orders - [===
DeMSignal Parameters ===]DeM_CloseInSignals=true//DeMClose Orders Via Signals - [===
DeMSignal Parameters ===]DeM_CloseOrdersType= 4 //DeMType Of CloseOrders(0=Not Use)(from 1 to 4) - [===
DeMSignal Parameters ===]DeM_LevelCloseOrders=70.0//DeMLevel Close Orders - [===
DeMOrder Management ===]DeM_TypeOfLevelsUse= Use_Only_Virtual_Levels //DeMType Of Levels Use To Close Orders - [===
DeMOrder Management ===]DeM_TakeProfit=5.0//DeMPips TakeProfit(0=Not Use) - [===
DeMOrder Management ===]DeM_StopLoss=60.0//DeMPips StopLoss(0=Not Use) - [===
DeMMoney Management ===]DeM_AutoLotSize=true//DeMAuto Money Management - [===
DeMMoney Management ===]DeM_RiskFactor=1.0//DeMRisk Money Management - [===
DeMMoney Management ===]DeM_ManualLotSize=0.10//DeMManual Lot Size - [===
DeMRecovery Settings ===]DeM_UseRecoveryLot= Not_Use_Recovery //DeMUse Recovery Lot Size After Losses - [===
DeMRecovery Settings ===]DeM_MultiRecoveryLot=2.0//DeMMultiplier For Recovery Lot Size - [===
FBBSTRATEGY===] FBB_StrategyRun =true//FBBStrategy Run - [===
FBBIndicator Parameters ===] FBB_BarsCalculate = 20 //FBBBars Calculate Signals - [===
FBBIndicator Parameters ===] FBB_Deviation =1.8//FBBBands Deviation - [===
FBBSignal Parameters ===] FBB_OpenOrdersType_1 = 1 //FBBType Of Open Orders 1 (0=Not Use)(from 1 to 2) - [===
FBBSignal Parameters ===] FBB_OpenOrdersType_2 = 8 //FBBType Of Open Orders 2 (0=Not Use)(from 1 to 8) - [===
FBBSignal Parameters ===] FBB_LevelOpenOrders_1 =0.0//FBBLevel Open Orders 1 (0=Not Use)(Positive and Negative) - [===
FBBSignal Parameters ===] FBB_LevelOpenOrders_2 =50.0//FBBLevel Open Orders 2 - [===
FBBSignal Parameters ===] FBB_CloseInSignals =false//FBBClose Orders Via Signals - [===
FBBSignal Parameters ===] FBB_CloseOrdersType_1 = 1 //FBBType Of Close Orders 1 (0=Not Use)(from 1 to 2) - [===
FBBSignal Parameters ===] FBB_CloseOrdersType_2 = 4 //FBBType Of Close Orders 2 (0=Not Use)(from 1 to 8) - [===
FBBSignal Parameters ===] FBB_LevelCloseOrders_1 =40.0//FBBLevel Close Orders 1 (0=Not Use)(Positive and Negative) - [===
FBBSignal Parameters ===] FBB_LevelCloseOrders_2 =40.0//FBBLevel Close Orders 2 - [===
FBBOrder Management ===] FBB_TypeOfLevelsUse = Use_Only_Virtual_Levels //FBBType Of Levels Use To Close Orders - [===
FBBOrder Management ===] FBB_TakeProfit =5.0//FBBPips TakeProfit(0=Not Use) - [===
FBBOrder Management ===] FBB_StopLoss =15.0//FBBPips StopLoss(0=Not Use) - [===
FBBMoney Management ===] FBB_AutoLotSize =true//FBBAuto Money Management - [===
FBBMoney Management ===] FBB_RiskFactor =1.0//FBBRisk Money Management - [===
FBBMoney Management ===] FBB_ManualLotSize =0.10//FBBManual Lot Size - [===
FBBRecovery Settings ===] FBB_UseRecoveryLot = Not_Use_Recovery //FBBUse Recovery Lot Size After Losses - [===
FBBRecovery Settings ===] FBB_MultiRecoveryLot =2.0//FBBMultiplier For Recovery Lot Size - [===
MFISTRATEGY===] MFI_StrategyRun =true//MFIStrategy Run - [===
MFIIndicator Parameters ===] MFI_BarsCalculate = 12 //MFI_Bars Calculate Signals - [===
MFISignal Parameters ===] MFI_OpenOrdersType = 3 //MFIType Of OpenOrders(0=Not Use)(from 1 to 4) - [===
MFISignal Parameters ===] MFI_LevelOpenOrders =90.0//MFILevel Open Orders - [===
MFISignal Parameters ===] MFI_CloseInSignals =true//MFIClose Orders Via Signals - [===
MFISignal Parameters ===] MFI_CloseOrdersType = 4 //MFIType Of CloseOrders(0=Not Use)(from 1 to 4) - [===
MFISignal Parameters ===] MFI_LevelCloseOrders =90.0//MFILevel Close Orders - [===
MFIOrder Management ===] MFI_TypeOfLevelsUse = Use_Only_Virtual_Levels //MFIType Of Levels Use To Close Orders - [===
MFIOrder Management ===] MFI_TakeProfit =50.0//MFIPips TakeProfit(0=Not Use) - [===
MFIOrder Management ===] MFI_StopLoss =25.0//MFIPips StopLoss(0=Not Use) - [===
MFIMoney Management ===] MFI_AutoLotSize =true//MFIAuto Money Management - [===
MFIMoney Management ===] MFI_RiskFactor =1.0//MFIRisk Money Management - [===
MFIMoney Management ===] MFI_ManualLotSize =0.10//MFIManual Lot Size - [===
MFIRecovery Settings ===] MFI_UseRecoveryLot = Not_Use_Recovery //MFIUse Recovery Lot Size After Losses - [===
MFIRecovery Settings ===] MFI_MultiRecoveryLot =2.0//MFIMultiplier For Recovery Lot Size - [=== MS
STRATEGY===] MS_StrategyRun =true// MS Strategy Run - [=== MS Indicator Parameters ===] MS_Fast_EMA_Period = 3 // MS
MACDFastEMAPeriod - [=== MS Indicator Parameters ===] MS_Slow_EMA_Period = 9 // MS
MACDSlowEMAPeriod - [=== MS Indicator Parameters ===] MS_Signal_Period = 2 // MS
MACDSignal Period - [=== MS Indicator Parameters ===] MS_K_Period = 5 // MS
STOCHK Period - [=== MS Indicator Parameters ===] MS_D_Period = 3 // MS
STOCHD Period - [=== MS Indicator Parameters ===] MS_Slowing_Period = 12 // MS
STOCHSlowing Period - [=== MS Signal Parameters ===] MS_OpenOrdersType_1 = 8 // MS Type Of Open Orders 1 (0=Not Use)(from 1 to 11)
- [=== MS Signal Parameters ===] MS_OpenOrdersType_2 = 22 // MS Type Of Open Orders 2 (0=Not Use)(from 1 to 28)
- [=== MS Signal Parameters ===] MS_LevelOpenOrders_1 =
60.0// MS Level Open Orders 1 - [=== MS Signal Parameters ===] MS_LevelOpenOrders_2 =
80.0// MS Level Open Orders 2 - [=== MS Signal Parameters ===] MS_CloseInSignals =
true// MS Close Orders Via Signals - [=== MS Signal Parameters ===] MS_CloseOrdersType_1 = 9 // MS Type Of Close Orders 1 (0=Not Use)(from 1 to 11)
- [=== MS Signal Parameters ===] MS_CloseOrdersType_2 = 10 // MS Type Of Close Orders 2 (0=Not Use)(from 1 to 28)
- [=== MS Signal Parameters ===] MS_LevelCloseOrders_1 =
50.0// MS Level Close Orders 1 - [=== MS Signal Parameters ===] MS_LevelCloseOrders_2 =
65.0// MS Level Close Orders 2 - [=== MS Order Management ===] MS_TypeOfLevelsUse = Use_Only_Virtual_Levels // MS Type Of Levels Use To Close Orders
- [=== MS Order Management ===] MS_TakeProfit =
10.0// MS Pips TakeProfit(0=Not Use) - [=== MS Order Management ===] MS_StopLoss =
45.0// MS Pips StopLoss(0=Not Use) - [=== MS Money Management ===] MS_AutoLotSize =
true// MS Auto Money Management - [=== MS Money Management ===] MS_RiskFactor =
1.0// MS Risk Money Management - [=== MS Money Management ===] MS_ManualLotSize =
0.10// MS Manual Lot Size - [=== MS Recovery Settings ===] MS_UseRecoveryLot = Not_Use_Recovery // MS Use Recovery Lot Size After Losses
- [=== MS Recovery Settings ===] MS_MultiRecoveryLot =
2.0// MS Multiplier For Recovery Lot Size - [===
ORDERSGRIDSETTINGS===]MakeOrdersGrid= Not_Make_Grid // Make Grid Of Orders - [===
ORDERSGRIDSETTINGS===]PipsBetweenOrders=0.0// Pips Between Orders - [===
ORDERSGRIDSETTINGS===]TimeBetweenOrders= 60 // Seconds Between Orders - [===
TRADINGSESSION===]ControlSession=true// Use Trade Control Session - [===
TRADINGSESSION===]WaitAfterOpen= 60 // Wait After Monday Open - [===
TRADINGSESSION===]StopBeforeClose= 60 // Stop Before Friday Close - [===
CHARTDISPLAY===]ShowComments=true// Show Comments On Chart - [===
CHARTDISPLAY===]ColorOffLines=clrGray// Color Off Lines - [===
CHARTDISPLAY===]ColorExpertName=clrDodgerBlue// Color Expert Name - [===
CHARTDISPLAY===]ColorSpreadInfo=clrLightSkyBlue// Color Spread Information - [===
CHARTDISPLAY===]ColorMoneyMngmnt=clrLightBlue// Color Money Management - [===
CHARTDISPLAY===]ColorCurrentOrders=clrPaleTurquoise// Color Current Orders - [===
CHARTDISPLAY===]ColorHistoryOrders=clrLightCyan// Color History Orders - [===
GENERALEXPERTSETTINGS===]MaxSpread=0.0// Max AcceptedSpread(0=Not Limit) - [===
GENERALEXPERTSETTINGS===]MaxOrders= 0 // Max OpenedOrders(0=No Limit) - [===
GENERALEXPERTSETTINGS===] Slippage = 3 // Accepted Slippage - [===
GENERALEXPERTSETTINGS===]SoundAlert=false// Play Sound Alerts - [===
GENERALEXPERTSETTINGS===]PrintOperations=false//PrintInformation Log - [===
GENERALEXPERTSETTINGS===]MagicNumber= 0 // Orders'ID(0=Generate Automatically) - [===
GENERALEXPERTSETTINGS===]InpTradeComment= "Psgrowth.com Expert_12072" // Orders'Comment
// Pipsgrowth EX12072 MultiIndicatorConfluence — Execution Flow (from source analysis)
// Family: MultiIndicatorConfluence
// Multi-strategy EA combining AC, ADX, AO, DeM, FBB, MFI and MS indicators with grid orders, recovery lot sizing, session control and multi-pair trading support. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
ON_INIT:
Create indicator handles: standard set
Initialize state variables
Detect broker GMT offset
ON_TICK:
1. Refresh indicator buffers (closed-bar shift=1)
2. Manage existing positions:
- Break-even check
- ATR trailing stop
- Profit lock ratchet
- Time-based exit
- Opposite-signal exit
3. If new bar:
a. ClassifyRegime() — ADX/ATR/BB regime detection
b. NoTradeGate() checks:
- Market open + session filter
- Spread limit
- Cooldown after loss
- Consecutive loss limit
- Kill switch
- Max drawdown
- Max concurrent positions
- Daily/weekly loss limits
c. GenerateSignal() — strategy-specific entry logic
d. CheckConfirm() — HTF alignment + R:R + ADX minimum
e. Calculate position size from risk %
f. Execute with retry logic
g. Mark bar to prevent duplicates
ON_TESTER:
Custom fitness = weighted(RecoveryFactor, ROI, ProfitFactor, TradeCount, Sharpe, Drawdown)Optimization Profile
How to Install This EA on MT5
- 1Download the .mq5 file using the button above
- 2Open MetaTrader 5 on your computer
- 3Click File → Open Data Folder in the top menu
- 4Navigate to MQL5 → Experts and paste the .mq5 file there
- 5In MT5, right-click Expert Advisors in the Navigator panel → Refresh
- 6Drag the EA onto a chart matching the recommended timeframe
- 7Configure parameters according to the table on this page
- 8Enable Allow Algo Trading and click OK
EA Parameters
| Parameter | Default | Description |
|---|---|---|
| TypeOperation | Normal_Operation | Type Of Operation |
| SetChartUses | true | Set Automatically Chart To Use |
| PairToTrade | TRADE_EURUSD_4 | Symbol Expert Trade |
| TimeFrame | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)//Period Of Bars |
| CloseInReverse | true | Close Orders In Reverse Signal |
| TradeAllStrategies | true | Trade All Strategies Together |
| AC_StrategyRun | true | AC Strategy Run |
| AC_OpenOrdersType | 5 | AC Type Of Open Orders (0=Not Use)(from 1 to 8) |
| AC_LevelOpenOrders | 80.0 | AC Level Open Orders |
| AC_CloseInSignals | true | AC Close Orders With Signals |
| AC_CloseOrdersType | 1 | AC Type Of Close Orders (0=Not Use)(from 1 to 8) |
| AC_LevelCloseOrders | 70.0 | AC Level Close Orders |
| AC_TypeOfLevelsUse | Use_Only_Virtual_Levels | AC Type Of Levels Use To Close Orders |
| AC_TakeProfit | 95.0 | AC Pips Take Profit (0=Not Use) |
| AC_StopLoss | 85.0 | AC Pips Stop Loss (0=Not Use) |
| AC_AutoLotSize | true | AC Auto Money Management |
| AC_RiskFactor | 1.0 | AC Risk Money Management |
| AC_ManualLotSize | 0.10 | AC Manual Lot Size |
| AC_UseRecoveryLot | Not_Use_Recovery | AC Use Recovery Lot Size After Losses |
| AC_MultiRecoveryLot | 2.0 | AC Multiplier For Recovery Lot Size |
| ADX_StrategyRun | true | ADX Strategy Run |
| ADX_BarsCalculate | 20 | ADX Bars Calculate Signals |
| ADX_OpenOrdersType | 2 | ADX Type Of Open Orders (0=Not Use)(from 1 to 4) |
| ADX_LevelOpenOrders_1 | 55.0 | ADX Level Open Orders 1 |
| ADX_LevelOpenOrders_2 | 15.0 | ADX Level Open Orders 2 |
| ADX_CloseInSignals | true | ADX Close Orders With Signals |
| ADX_CloseOrdersType | 4 | ADX Type Of Close Orders (0=Not Use)(from 1 to 4) |
| ADX_LevelCloseOrders_1 | 15.0 | ADX Level Close Orders 1 |
| ADX_LevelCloseOrders_2 | 5.0 | ADX Level Close Orders 2 |
| ADX_TypeOfLevelsUse | Use_Only_Virtual_Levels | ADX Type Of Levels Use To Close Orders |
| ADX_TakeProfit | 35.0 | ADX Pips Take Profit (0=Not Use) |
| ADX_StopLoss | 70.0 | ADX Pips Stop Loss (0=Not Use) |
| ADX_AutoLotSize | true | ADX Auto Money Management |
| ADX_RiskFactor | 1.0 | ADX Risk Money Management |
| ADX_ManualLotSize | 0.10 | ADX Manual Lot Size |
| ADX_UseRecoveryLot | Not_Use_Recovery | ADX Use Recovery Lot Size After Losses |
| ADX_MultiRecoveryLot | 2.0 | ADX Multiplier For Recovery Lot Size |
| AO_StrategyRun | true | AO Strategy Run |
| AO_OpenOrdersType | 6 | AO Type Of Open Orders (0=Not Use)(from 1 to 8) |
| AO_LevelOpenOrders | 55.0 | AO Level Open Orders |
| AO_CloseInSignals | true | AO Close Orders Via Signals |
| AO_CloseOrdersType | 8 | AO Type Of Close Orders (0=Not Use)(from 1 to 8) |
| AO_LevelCloseOrders | 40.0 | AO Level Close Orders |
| AO_TypeOfLevelsUse | Use_Only_Virtual_Levels | AO Type Of Levels Use To Close Orders |
| AO_TakeProfit | 10.0 | AO Pips Take Profit (0=Not Use) |
| AO_StopLoss | 80.0 | AO Pips Stop Loss (0=Not Use) |
| AO_AutoLotSize | true | AO Auto Money Management |
| AO_RiskFactor | 1.0 | AO Risk Money Management |
| AO_ManualLotSize | 0.10 | AO Manual Lot Size |
| AO_UseRecoveryLot | Not_Use_Recovery | AO Use Recovery Lot Size After Losses |
| AO_MultiRecoveryLot | 2.0 | AO Multiplier For Recovery Lot Size |
| DeM_StrategyRun | true | DeM Strategy Run |
| DeM_BarsCalculate | 20 | DeM_ Bars Calculate Signals |
| DeM_OpenOrdersType | 3 | DeM Type Of Open Orders (0=Not Use)(from 1 to 4) |
| DeM_LevelOpenOrders | 75.0 | DeM Level Open Orders |
| DeM_CloseInSignals | true | DeM Close Orders Via Signals |
| DeM_CloseOrdersType | 4 | DeM Type Of Close Orders (0=Not Use)(from 1 to 4) |
| DeM_LevelCloseOrders | 70.0 | DeM Level Close Orders |
| DeM_TypeOfLevelsUse | Use_Only_Virtual_Levels | DeM Type Of Levels Use To Close Orders |
| DeM_TakeProfit | 5.0 | DeM Pips Take Profit (0=Not Use) |
| DeM_StopLoss | 60.0 | DeM Pips Stop Loss (0=Not Use) |
| DeM_AutoLotSize | true | DeM Auto Money Management |
| DeM_RiskFactor | 1.0 | DeM Risk Money Management |
| DeM_ManualLotSize | 0.10 | DeM Manual Lot Size |
| DeM_UseRecoveryLot | Not_Use_Recovery | DeM Use Recovery Lot Size After Losses |
| DeM_MultiRecoveryLot | 2.0 | DeM Multiplier For Recovery Lot Size |
| FBB_StrategyRun | true | FBB Strategy Run |
| FBB_BarsCalculate | 20 | FBB Bars Calculate Signals |
| FBB_Deviation | 1.8 | FBB Bands Deviation |
| FBB_OpenOrdersType_1 | 1 | FBB Type Of Open Orders 1 (0=Not Use)(from 1 to 2) |
| FBB_OpenOrdersType_2 | 8 | FBB Type Of Open Orders 2 (0=Not Use)(from 1 to 8) |
| FBB_LevelOpenOrders_1 | 0.0 | FBB Level Open Orders 1 (0=Not Use)(Positive and Negative) |
| FBB_LevelOpenOrders_2 | 50.0 | FBB Level Open Orders 2 |
| FBB_CloseInSignals | false | FBB Close Orders Via Signals |
| FBB_CloseOrdersType_1 | 1 | FBB Type Of Close Orders 1 (0=Not Use)(from 1 to 2) |
| FBB_CloseOrdersType_2 | 4 | FBB Type Of Close Orders 2 (0=Not Use)(from 1 to 8) |
| FBB_LevelCloseOrders_1 | 40.0 | FBB Level Close Orders 1 (0=Not Use)(Positive and Negative) |
| FBB_LevelCloseOrders_2 | 40.0 | FBB Level Close Orders 2 |
| FBB_TypeOfLevelsUse | Use_Only_Virtual_Levels | FBB Type Of Levels Use To Close Orders |
| FBB_TakeProfit | 5.0 | FBB Pips Take Profit (0=Not Use) |
| FBB_StopLoss | 15.0 | FBB Pips Stop Loss (0=Not Use) |
| FBB_AutoLotSize | true | FBB Auto Money Management |
| FBB_RiskFactor | 1.0 | FBB Risk Money Management |
| FBB_ManualLotSize | 0.10 | FBB Manual Lot Size |
| FBB_UseRecoveryLot | Not_Use_Recovery | FBB Use Recovery Lot Size After Losses |
| FBB_MultiRecoveryLot | 2.0 | FBB Multiplier For Recovery Lot Size |
| MFI_StrategyRun | true | MFI Strategy Run |
| MFI_BarsCalculate | 12 | MFI_ Bars Calculate Signals |
| MFI_OpenOrdersType | 3 | MFI Type Of Open Orders (0=Not Use)(from 1 to 4) |
| MFI_LevelOpenOrders | 90.0 | MFI Level Open Orders |
| MFI_CloseInSignals | true | MFI Close Orders Via Signals |
| MFI_CloseOrdersType | 4 | MFI Type Of Close Orders (0=Not Use)(from 1 to 4) |
| MFI_LevelCloseOrders | 90.0 | MFI Level Close Orders |
| MFI_TypeOfLevelsUse | Use_Only_Virtual_Levels | MFI Type Of Levels Use To Close Orders |
| MFI_TakeProfit | 50.0 | MFI Pips Take Profit (0=Not Use) |
| MFI_StopLoss | 25.0 | MFI Pips Stop Loss (0=Not Use) |
| MFI_AutoLotSize | true | MFI Auto Money Management |
| MFI_RiskFactor | 1.0 | MFI Risk Money Management |
| MFI_ManualLotSize | 0.10 | MFI Manual Lot Size |
| MFI_UseRecoveryLot | Not_Use_Recovery | MFI Use Recovery Lot Size After Losses |
| MFI_MultiRecoveryLot | 2.0 | MFI Multiplier For Recovery Lot Size |
| MS_StrategyRun | true | MS Strategy Run |
| MS_Fast_EMA_Period | 3 | MS MACD Fast EMA Period |
| MS_Slow_EMA_Period | 9 | MS MACD Slow EMA Period |
| MS_Signal_Period | 2 | MS MACD Signal Period |
| MS_K_Period | 5 | MS STOCH K Period |
| MS_D_Period | 3 | MS STOCH D Period |
| MS_Slowing_Period | 12 | MS STOCH Slowing Period |
| MS_OpenOrdersType_1 | 8 | MS Type Of Open Orders 1 (0=Not Use)(from 1 to 11) |
| MS_OpenOrdersType_2 | 22 | MS Type Of Open Orders 2 (0=Not Use)(from 1 to 28) |
| MS_LevelOpenOrders_1 | 60.0 | MS Level Open Orders 1 |
| MS_LevelOpenOrders_2 | 80.0 | MS Level Open Orders 2 |
| MS_CloseInSignals | true | MS Close Orders Via Signals |
| MS_CloseOrdersType_1 | 9 | MS Type Of Close Orders 1 (0=Not Use)(from 1 to 11) |
| MS_CloseOrdersType_2 | 10 | MS Type Of Close Orders 2 (0=Not Use)(from 1 to 28) |
| MS_LevelCloseOrders_1 | 50.0 | MS Level Close Orders 1 |
| MS_LevelCloseOrders_2 | 65.0 | MS Level Close Orders 2 |
| MS_TypeOfLevelsUse | Use_Only_Virtual_Levels | MS Type Of Levels Use To Close Orders |
| MS_TakeProfit | 10.0 | MS Pips Take Profit (0=Not Use) |
| MS_StopLoss | 45.0 | MS Pips Stop Loss (0=Not Use) |
| MS_AutoLotSize | true | MS Auto Money Management |
| MS_RiskFactor | 1.0 | MS Risk Money Management |
| MS_ManualLotSize | 0.10 | MS Manual Lot Size |
| MS_UseRecoveryLot | Not_Use_Recovery | MS Use Recovery Lot Size After Losses |
| MS_MultiRecoveryLot | 2.0 | MS Multiplier For Recovery Lot Size |
| MakeOrdersGrid | Not_Make_Grid | Make Grid Of Orders |
| PipsBetweenOrders | 0.0 | Pips Between Orders |
| TimeBetweenOrders | 60 | Seconds Between Orders |
| ControlSession | true | Use Trade Control Session |
| WaitAfterOpen | 60 | Wait After Monday Open |
| StopBeforeClose | 60 | Stop Before Friday Close |
| ShowComments | true | Show Comments On Chart |
| ColorOffLines | clrGray | Color Off Lines |
| ColorExpertName | clrDodgerBlue | Color Expert Name |
| ColorSpreadInfo | clrLightSkyBlue | Color Spread Information |
| ColorMoneyMngmnt | clrLightBlue | Color Money Management |
| ColorCurrentOrders | clrPaleTurquoise | Color Current Orders |
| ColorHistoryOrders | clrLightCyan | Color History Orders |
| MaxSpread | 0.0 | Max Accepted Spread (0=Not Limit) |
| MaxOrders | 0 | Max Opened Orders (0=No Limit) |
| Slippage | 3 | Accepted Slippage |
| SoundAlert | false | Play Sound Alerts |
| PrintOperations | false | Print Information Log |
| MagicNumber | 0 | Orders' ID (0=Generate Automatically) |
| InpTradeComment | "Psgrowth.com Expert_12072" | Orders' Comment |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX12072 MultiStrategyEA_v1_2 — Multi-strategy EA (AC+ADX+AO+DeM+FBB+MFI+MS), full 12-layer stack."
#include <Trade\Trade.mqh>
//============================================================================================================================================================================================================================//
#define MagicSet 22212072
//============================================================================================================================================================================================================================//
enum Oper {Stand_by_Mode, Normal_Operation, Close_Immediately_All_Orders};
enum Grid {Not_Make_Grid, Make_Grid_In_Loss, Make_Grid_In_Profit, Make_Grid_Loss_And_Profit};
enum Levels {Use_Only_Hard_Levels, Use_Only_Virtual_Levels, Use_Hard_And_Virtual_Levels};
enum LotPr {Statical_Lot, Geometrical_Lot, Exponetial_Lot};
enum Recov {Not_Use_Recovery, Use_Last_Closing, Use_Higher_Profits};
enum Pair {CHART_PAIR, TRADE_EURGBP_1, TRADE_EURAUD_2, TRADE_EURNZD_3, TRADE_EURUSD_4, TRADE_EURCAD_5, TRADE_EURCHF_6, TRADE_EURJPY_7,
TRADE_GBPAUD_8, TRADE_GBPNZD_9, TRADE_GBPUSD_10, TRADE_GBPCAD_11, TRADE_GBPCHF_12, TRADE_GBPJPY_13, TRADE_AUDNZD_14,
TRADE_AUDUSD_15, TRADE_AUDCAD_16, TRADE_AUDCHF_17, TRADE_AUDJPY_18, TRADE_NZDUSD_19, TRADE_NZDCAD_20, TRADE_NZDCHF_21,
TRADE_NZDJPY_22, TRADE_USDCAD_23, TRADE_USDCHF_24, TRADE_USDJPY_25, TRADE_CADCHF_26, TRADE_CADJPY_27, TRADE_CHFJPY_28
};
//============================================================================================================================================================================================================================//
//Comon parameters
//============================================================================================================================================================================================================================//
ENUM_TIMEFRAMES MapTimeframeInt(int tf)
{
switch(tf)
{
case 1: return PERIOD_M1;
case 2: return PERIOD_M5;
case 3: return PERIOD_M15;
case 4: return PERIOD_M30;
case 5: return PERIOD_H1;
case 6: return PERIOD_H4;
case 7: return PERIOD_D1;
default: return PERIOD_H1;
}
}
ENUM_TIMEFRAMES g_TimeFrame = PERIOD_H1;
input group "=== OPERATION SETTINGS ==="
input Oper TypeOperation = Normal_Operation;//Type Of Operation
ENUM_TIMEFRAMES MapTimeframeInt(int tf)
{
switch(tf)
{
case 1: return PERIOD_M1;
case 2: return PERIOD_M5;
case 3: return PERIOD_M15;
case 4: return PERIOD_M30;
case 5: return PERIOD_H1;
case 6: return PERIOD_H4;
case 7: return PERIOD_D1;
default: return PERIOD_H1;
}
}
ENUM_TIMEFRAMES g_TimeFrame = PERIOD_H1;
input group "=== CHART & SYMBOL SETTINGS ==="
input bool SetChartUses = true;//Set Automatically Chart To Use
input Pair PairToTrade = TRADE_EURUSD_4;//Symbol Expert Trade
ENUM_TIMEFRAMES MapTimeframeInt(int tf)Full source code available on download
Educational purposes only. Do NOT use with real money. Test on demo accounts only.
Clear Warning: Educational Purposes Only
Clear Warning: This Expert Advisor is for educational and testing purposes only. Do NOT use it with real money. Test only on demo accounts. Trading with real money involves substantial risk of capital loss. This does not constitute investment advice.
Recommended Brokers for This EA
These EAs run on MT5 — use a regulated broker with fast execution and tight spreads
Markets.com
Exness
IC Markets
Similar Expert Advisors
View All Expert AdvisorsMore Other strategy EAs from our library
Pipsgrowth EX01007 Adaptive
Pipsgrowth.com EX01007 Adaptive XAUUSD 5M — multi-indicator signal scorer with regime filter, full 12-layer stack, configurable timeframe, trailing/BE/profit-lock toggles, pyramid gate, spread filter, new-bar gate, filling mode detection.
Pipsgrowth EX01019 Adaptive
Pipsgrowth.com EX01019 Self-Adaptive Market EA Fixed — multi-regime adaptive EA, full 12-layer stack.
Pipsgrowth EX15029 SMC-OrderBlock
Pipsgrowth.com EX15029 SMCBreakoutEA — SMC breakout CHOCH/liquidity sweep EA, full 12-layer stack.
Community
Educational purposes only. Do NOT use with real money. Test on demo accounts only.