P
PipsGrowth
OtherOpen Source – Free

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.

Entry Signal

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.

Exit Signal

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.

Stop Loss

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.

Take Profit

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.

Best For

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 MT5 indicators

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):

  • [=== OPERATION SETTINGS ===] TypeOperation = Normal_Operation // Type Of Operation
  • [=== CHART & SYMBOL SETTINGS ===] SetChartUses = true // Set Automatically Chart To Use
  • [=== CHART & SYMBOL SETTINGS ===] PairToTrade = TRADE_EURUSD_4 // Symbol Expert Trade
  • [=== GENERAL TRADING SETTINGS ===] TimeFrame = 8 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)//Period Of Bars
  • [=== GENERAL TRADING SETTINGS ===] CloseInReverse = true // Close Orders In Reverse Signal
  • [=== GENERAL TRADING SETTINGS ===] 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 Take Profit (0=Not Use)
  • [=== AC Order Management ===] AC_StopLoss = 85.0 // AC Pips Stop Loss (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
  • [=== ADX STRATEGY ===] ADX_StrategyRun = true // ADX Strategy Run
  • [=== ADX Indicator Parameters ===] ADX_BarsCalculate = 20 // ADX Bars Calculate Signals
  • [=== ADX Signal Parameters ===] ADX_OpenOrdersType = 2 // ADX Type Of Open Orders (0=Not Use)(from 1 to 4)
  • [=== ADX Signal Parameters ===] ADX_LevelOpenOrders_1 = 55.0 // ADX Level Open Orders 1
  • [=== ADX Signal Parameters ===] ADX_LevelOpenOrders_2 = 15.0 // ADX Level Open Orders 2
  • [=== ADX Signal Parameters ===] ADX_CloseInSignals = true // ADX Close Orders With Signals
  • [=== ADX Signal Parameters ===] ADX_CloseOrdersType = 4 // ADX Type Of Close Orders (0=Not Use)(from 1 to 4)
  • [=== ADX Signal Parameters ===] ADX_LevelCloseOrders_1 = 15.0 // ADX Level Close Orders 1
  • [=== ADX Signal Parameters ===] ADX_LevelCloseOrders_2 = 5.0 // ADX Level Close Orders 2
  • [=== ADX Order Management ===] ADX_TypeOfLevelsUse = Use_Only_Virtual_Levels // ADX Type Of Levels Use To Close Orders
  • [=== ADX Order Management ===] ADX_TakeProfit = 35.0 // ADX Pips Take Profit (0=Not Use)
  • [=== ADX Order Management ===] ADX_StopLoss = 70.0 // ADX Pips Stop Loss (0=Not Use)
  • [=== ADX Money Management ===] ADX_AutoLotSize = true // ADX Auto Money Management
  • [=== ADX Money Management ===] ADX_RiskFactor = 1.0 // ADX Risk Money Management
  • [=== ADX Money Management ===] ADX_ManualLotSize = 0.10 // ADX Manual Lot Size
  • [=== ADX Recovery Settings ===] ADX_UseRecoveryLot = Not_Use_Recovery // ADX Use Recovery Lot Size After Losses
  • [=== ADX Recovery Settings ===] ADX_MultiRecoveryLot = 2.0 // ADX Multiplier 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 Take Profit (0=Not Use)
  • [=== AO Order Management ===] AO_StopLoss = 80.0 // AO Pips Stop Loss (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
  • [=== DEM STRATEGY ===] DeM_StrategyRun = true // DeM Strategy Run
  • [=== DeM Indicator Parameters ===] DeM_BarsCalculate = 20 // DeM_ Bars Calculate Signals
  • [=== DeM Signal Parameters ===] DeM_OpenOrdersType = 3 // DeM Type Of Open Orders (0=Not Use)(from 1 to 4)
  • [=== DeM Signal Parameters ===] DeM_LevelOpenOrders = 75.0 // DeM Level Open Orders
  • [=== DeM Signal Parameters ===] DeM_CloseInSignals = true // DeM Close Orders Via Signals
  • [=== DeM Signal Parameters ===] DeM_CloseOrdersType = 4 // DeM Type Of Close Orders (0=Not Use)(from 1 to 4)
  • [=== DeM Signal Parameters ===] DeM_LevelCloseOrders = 70.0 // DeM Level Close Orders
  • [=== DeM Order Management ===] DeM_TypeOfLevelsUse = Use_Only_Virtual_Levels // DeM Type Of Levels Use To Close Orders
  • [=== DeM Order Management ===] DeM_TakeProfit = 5.0 // DeM Pips Take Profit (0=Not Use)
  • [=== DeM Order Management ===] DeM_StopLoss = 60.0 // DeM Pips Stop Loss (0=Not Use)
  • [=== DeM Money Management ===] DeM_AutoLotSize = true // DeM Auto Money Management
  • [=== DeM Money Management ===] DeM_RiskFactor = 1.0 // DeM Risk Money Management
  • [=== DeM Money Management ===] DeM_ManualLotSize = 0.10 // DeM Manual Lot Size
  • [=== DeM Recovery Settings ===] DeM_UseRecoveryLot = Not_Use_Recovery // DeM Use Recovery Lot Size After Losses
  • [=== DeM Recovery Settings ===] DeM_MultiRecoveryLot = 2.0 // DeM Multiplier For Recovery Lot Size
  • [=== FBB STRATEGY ===] FBB_StrategyRun = true // FBB Strategy Run
  • [=== FBB Indicator Parameters ===] FBB_BarsCalculate = 20 // FBB Bars Calculate Signals
  • [=== FBB Indicator Parameters ===] FBB_Deviation = 1.8 // FBB Bands Deviation
  • [=== FBB Signal Parameters ===] FBB_OpenOrdersType_1 = 1 // FBB Type Of Open Orders 1 (0=Not Use)(from 1 to 2)
  • [=== FBB Signal Parameters ===] FBB_OpenOrdersType_2 = 8 // FBB Type Of Open Orders 2 (0=Not Use)(from 1 to 8)
  • [=== FBB Signal Parameters ===] FBB_LevelOpenOrders_1 = 0.0 // FBB Level Open Orders 1 (0=Not Use)(Positive and Negative)
  • [=== FBB Signal Parameters ===] FBB_LevelOpenOrders_2 = 50.0 // FBB Level Open Orders 2
  • [=== FBB Signal Parameters ===] FBB_CloseInSignals = false // FBB Close Orders Via Signals
  • [=== FBB Signal Parameters ===] FBB_CloseOrdersType_1 = 1 // FBB Type Of Close Orders 1 (0=Not Use)(from 1 to 2)
  • [=== FBB Signal Parameters ===] FBB_CloseOrdersType_2 = 4 // FBB Type Of Close Orders 2 (0=Not Use)(from 1 to 8)
  • [=== FBB Signal Parameters ===] FBB_LevelCloseOrders_1 = 40.0 // FBB Level Close Orders 1 (0=Not Use)(Positive and Negative)
  • [=== FBB Signal Parameters ===] FBB_LevelCloseOrders_2 = 40.0 // FBB Level Close Orders 2
  • [=== FBB Order Management ===] FBB_TypeOfLevelsUse = Use_Only_Virtual_Levels // FBB Type Of Levels Use To Close Orders
  • [=== FBB Order Management ===] FBB_TakeProfit = 5.0 // FBB Pips Take Profit (0=Not Use)
  • [=== FBB Order Management ===] FBB_StopLoss = 15.0 // FBB Pips Stop Loss (0=Not Use)
  • [=== FBB Money Management ===] FBB_AutoLotSize = true // FBB Auto Money Management
  • [=== FBB Money Management ===] FBB_RiskFactor = 1.0 // FBB Risk Money Management
  • [=== FBB Money Management ===] FBB_ManualLotSize = 0.10 // FBB Manual Lot Size
  • [=== FBB Recovery Settings ===] FBB_UseRecoveryLot = Not_Use_Recovery // FBB Use Recovery Lot Size After Losses
  • [=== FBB Recovery Settings ===] FBB_MultiRecoveryLot = 2.0 // FBB Multiplier For Recovery Lot Size
  • [=== MFI STRATEGY ===] MFI_StrategyRun = true // MFI Strategy Run
  • [=== MFI Indicator Parameters ===] MFI_BarsCalculate = 12 // MFI_ Bars Calculate Signals
  • [=== MFI Signal Parameters ===] MFI_OpenOrdersType = 3 // MFI Type Of Open Orders (0=Not Use)(from 1 to 4)
  • [=== MFI Signal Parameters ===] MFI_LevelOpenOrders = 90.0 // MFI Level Open Orders
  • [=== MFI Signal Parameters ===] MFI_CloseInSignals = true // MFI Close Orders Via Signals
  • [=== MFI Signal Parameters ===] MFI_CloseOrdersType = 4 // MFI Type Of Close Orders (0=Not Use)(from 1 to 4)
  • [=== MFI Signal Parameters ===] MFI_LevelCloseOrders = 90.0 // MFI Level Close Orders
  • [=== MFI Order Management ===] MFI_TypeOfLevelsUse = Use_Only_Virtual_Levels // MFI Type Of Levels Use To Close Orders
  • [=== MFI Order Management ===] MFI_TakeProfit = 50.0 // MFI Pips Take Profit (0=Not Use)
  • [=== MFI Order Management ===] MFI_StopLoss = 25.0 // MFI Pips Stop Loss (0=Not Use)
  • [=== MFI Money Management ===] MFI_AutoLotSize = true // MFI Auto Money Management
  • [=== MFI Money Management ===] MFI_RiskFactor = 1.0 // MFI Risk Money Management
  • [=== MFI Money Management ===] MFI_ManualLotSize = 0.10 // MFI Manual Lot Size
  • [=== MFI Recovery Settings ===] MFI_UseRecoveryLot = Not_Use_Recovery // MFI Use Recovery Lot Size After Losses
  • [=== MFI Recovery Settings ===] MFI_MultiRecoveryLot = 2.0 // MFI Multiplier For Recovery Lot Size
  • [=== MS STRATEGY ===] MS_StrategyRun = true // MS Strategy Run
  • [=== MS Indicator Parameters ===] MS_Fast_EMA_Period = 3 // MS MACD Fast EMA Period
  • [=== MS Indicator Parameters ===] MS_Slow_EMA_Period = 9 // MS MACD Slow EMA Period
  • [=== MS Indicator Parameters ===] MS_Signal_Period = 2 // MS MACD Signal Period
  • [=== MS Indicator Parameters ===] MS_K_Period = 5 // MS STOCH K Period
  • [=== MS Indicator Parameters ===] MS_D_Period = 3 // MS STOCH D Period
  • [=== MS Indicator Parameters ===] MS_Slowing_Period = 12 // MS STOCH Slowing 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 Take Profit (0=Not Use)
  • [=== MS Order Management ===] MS_StopLoss = 45.0 // MS Pips Stop Loss (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
  • [=== ORDERS GRID SETTINGS ===] MakeOrdersGrid = Not_Make_Grid // Make Grid Of Orders
  • [=== ORDERS GRID SETTINGS ===] PipsBetweenOrders = 0.0 // Pips Between Orders
  • [=== ORDERS GRID SETTINGS ===] TimeBetweenOrders = 60 // Seconds Between Orders
  • [=== TRADING SESSION ===] ControlSession = true // Use Trade Control Session
  • [=== TRADING SESSION ===] WaitAfterOpen = 60 // Wait After Monday Open
  • [=== TRADING SESSION ===] StopBeforeClose = 60 // Stop Before Friday Close
  • [=== CHART DISPLAY ===] ShowComments = true // Show Comments On Chart
  • [=== CHART DISPLAY ===] ColorOffLines = clrGray // Color Off Lines
  • [=== CHART DISPLAY ===] ColorExpertName = clrDodgerBlue // Color Expert Name
  • [=== CHART DISPLAY ===] ColorSpreadInfo = clrLightSkyBlue // Color Spread Information
  • [=== CHART DISPLAY ===] ColorMoneyMngmnt = clrLightBlue // Color Money Management
  • [=== CHART DISPLAY ===] ColorCurrentOrders = clrPaleTurquoise // Color Current Orders
  • [=== CHART DISPLAY ===] ColorHistoryOrders = clrLightCyan // Color History Orders
  • [=== GENERAL EXPERT SETTINGS ===] MaxSpread = 0.0 // Max Accepted Spread (0=Not Limit)
  • [=== GENERAL EXPERT SETTINGS ===] MaxOrders = 0 // Max Opened Orders (0=No Limit)
  • [=== GENERAL EXPERT SETTINGS ===] Slippage = 3 // Accepted Slippage
  • [=== GENERAL EXPERT SETTINGS ===] SoundAlert = false // Play Sound Alerts
  • [=== GENERAL EXPERT SETTINGS ===] PrintOperations = false // Print Information Log
  • [=== GENERAL EXPERT SETTINGS ===] MagicNumber = 0 // Orders' ID (0=Generate Automatically)
  • [=== GENERAL EXPERT SETTINGS ===] InpTradeComment = "Psgrowth.com Expert_12072" // Orders' Comment
Pseudocode
// 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

Optimized Brokers:
ExnessIC Markets
Optimized Symbols:
XAUUSD
Optimized Timeframes:
M5

How to Install This EA on MT5

  1. 1Download the .mq5 file using the button above
  2. 2Open MetaTrader 5 on your computer
  3. 3Click File → Open Data Folder in the top menu
  4. 4Navigate to MQL5 → Experts and paste the .mq5 file there
  5. 5In MT5, right-click Expert Advisors in the Navigator panel → Refresh
  6. 6Drag the EA onto a chart matching the recommended timeframe
  7. 7Configure parameters according to the table on this page
  8. 8Enable Allow Algo Trading and click OK

EA Parameters

ParameterDefaultDescription
TypeOperationNormal_OperationType Of Operation
SetChartUsestrueSet Automatically Chart To Use
PairToTradeTRADE_EURUSD_4Symbol Expert Trade
TimeFrame8Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)//Period Of Bars
CloseInReversetrueClose Orders In Reverse Signal
TradeAllStrategiestrueTrade All Strategies Together
AC_StrategyRuntrueAC Strategy Run
AC_OpenOrdersType5AC Type Of Open Orders (0=Not Use)(from 1 to 8)
AC_LevelOpenOrders80.0AC Level Open Orders
AC_CloseInSignalstrueAC Close Orders With Signals
AC_CloseOrdersType1AC Type Of Close Orders (0=Not Use)(from 1 to 8)
AC_LevelCloseOrders70.0AC Level Close Orders
AC_TypeOfLevelsUseUse_Only_Virtual_LevelsAC Type Of Levels Use To Close Orders
AC_TakeProfit95.0AC Pips Take Profit (0=Not Use)
AC_StopLoss85.0AC Pips Stop Loss (0=Not Use)
AC_AutoLotSizetrueAC Auto Money Management
AC_RiskFactor1.0AC Risk Money Management
AC_ManualLotSize0.10AC Manual Lot Size
AC_UseRecoveryLotNot_Use_RecoveryAC Use Recovery Lot Size After Losses
AC_MultiRecoveryLot2.0AC Multiplier For Recovery Lot Size
ADX_StrategyRuntrueADX Strategy Run
ADX_BarsCalculate20ADX Bars Calculate Signals
ADX_OpenOrdersType2ADX Type Of Open Orders (0=Not Use)(from 1 to 4)
ADX_LevelOpenOrders_155.0ADX Level Open Orders 1
ADX_LevelOpenOrders_215.0ADX Level Open Orders 2
ADX_CloseInSignalstrueADX Close Orders With Signals
ADX_CloseOrdersType4ADX Type Of Close Orders (0=Not Use)(from 1 to 4)
ADX_LevelCloseOrders_115.0ADX Level Close Orders 1
ADX_LevelCloseOrders_25.0ADX Level Close Orders 2
ADX_TypeOfLevelsUseUse_Only_Virtual_LevelsADX Type Of Levels Use To Close Orders
ADX_TakeProfit35.0ADX Pips Take Profit (0=Not Use)
ADX_StopLoss70.0ADX Pips Stop Loss (0=Not Use)
ADX_AutoLotSizetrueADX Auto Money Management
ADX_RiskFactor1.0ADX Risk Money Management
ADX_ManualLotSize0.10ADX Manual Lot Size
ADX_UseRecoveryLotNot_Use_RecoveryADX Use Recovery Lot Size After Losses
ADX_MultiRecoveryLot2.0ADX Multiplier For Recovery Lot Size
AO_StrategyRuntrueAO Strategy Run
AO_OpenOrdersType6AO Type Of Open Orders (0=Not Use)(from 1 to 8)
AO_LevelOpenOrders55.0AO Level Open Orders
AO_CloseInSignalstrueAO Close Orders Via Signals
AO_CloseOrdersType8AO Type Of Close Orders (0=Not Use)(from 1 to 8)
AO_LevelCloseOrders40.0AO Level Close Orders
AO_TypeOfLevelsUseUse_Only_Virtual_LevelsAO Type Of Levels Use To Close Orders
AO_TakeProfit10.0AO Pips Take Profit (0=Not Use)
AO_StopLoss80.0AO Pips Stop Loss (0=Not Use)
AO_AutoLotSizetrueAO Auto Money Management
AO_RiskFactor1.0AO Risk Money Management
AO_ManualLotSize0.10AO Manual Lot Size
AO_UseRecoveryLotNot_Use_RecoveryAO Use Recovery Lot Size After Losses
AO_MultiRecoveryLot2.0AO Multiplier For Recovery Lot Size
DeM_StrategyRuntrueDeM Strategy Run
DeM_BarsCalculate20DeM_ Bars Calculate Signals
DeM_OpenOrdersType3DeM Type Of Open Orders (0=Not Use)(from 1 to 4)
DeM_LevelOpenOrders75.0DeM Level Open Orders
DeM_CloseInSignalstrueDeM Close Orders Via Signals
DeM_CloseOrdersType4DeM Type Of Close Orders (0=Not Use)(from 1 to 4)
DeM_LevelCloseOrders70.0DeM Level Close Orders
DeM_TypeOfLevelsUseUse_Only_Virtual_LevelsDeM Type Of Levels Use To Close Orders
DeM_TakeProfit5.0DeM Pips Take Profit (0=Not Use)
DeM_StopLoss60.0DeM Pips Stop Loss (0=Not Use)
DeM_AutoLotSizetrueDeM Auto Money Management
DeM_RiskFactor1.0DeM Risk Money Management
DeM_ManualLotSize0.10DeM Manual Lot Size
DeM_UseRecoveryLotNot_Use_RecoveryDeM Use Recovery Lot Size After Losses
DeM_MultiRecoveryLot2.0DeM Multiplier For Recovery Lot Size
FBB_StrategyRuntrueFBB Strategy Run
FBB_BarsCalculate20FBB Bars Calculate Signals
FBB_Deviation1.8FBB Bands Deviation
FBB_OpenOrdersType_11FBB Type Of Open Orders 1 (0=Not Use)(from 1 to 2)
FBB_OpenOrdersType_28FBB Type Of Open Orders 2 (0=Not Use)(from 1 to 8)
FBB_LevelOpenOrders_10.0FBB Level Open Orders 1 (0=Not Use)(Positive and Negative)
FBB_LevelOpenOrders_250.0FBB Level Open Orders 2
FBB_CloseInSignalsfalseFBB Close Orders Via Signals
FBB_CloseOrdersType_11FBB Type Of Close Orders 1 (0=Not Use)(from 1 to 2)
FBB_CloseOrdersType_24FBB Type Of Close Orders 2 (0=Not Use)(from 1 to 8)
FBB_LevelCloseOrders_140.0FBB Level Close Orders 1 (0=Not Use)(Positive and Negative)
FBB_LevelCloseOrders_240.0FBB Level Close Orders 2
FBB_TypeOfLevelsUseUse_Only_Virtual_LevelsFBB Type Of Levels Use To Close Orders
FBB_TakeProfit5.0FBB Pips Take Profit (0=Not Use)
FBB_StopLoss15.0FBB Pips Stop Loss (0=Not Use)
FBB_AutoLotSizetrueFBB Auto Money Management
FBB_RiskFactor1.0FBB Risk Money Management
FBB_ManualLotSize0.10FBB Manual Lot Size
FBB_UseRecoveryLotNot_Use_RecoveryFBB Use Recovery Lot Size After Losses
FBB_MultiRecoveryLot2.0FBB Multiplier For Recovery Lot Size
MFI_StrategyRuntrueMFI Strategy Run
MFI_BarsCalculate12MFI_ Bars Calculate Signals
MFI_OpenOrdersType3MFI Type Of Open Orders (0=Not Use)(from 1 to 4)
MFI_LevelOpenOrders90.0MFI Level Open Orders
MFI_CloseInSignalstrueMFI Close Orders Via Signals
MFI_CloseOrdersType4MFI Type Of Close Orders (0=Not Use)(from 1 to 4)
MFI_LevelCloseOrders90.0MFI Level Close Orders
MFI_TypeOfLevelsUseUse_Only_Virtual_LevelsMFI Type Of Levels Use To Close Orders
MFI_TakeProfit50.0MFI Pips Take Profit (0=Not Use)
MFI_StopLoss25.0MFI Pips Stop Loss (0=Not Use)
MFI_AutoLotSizetrueMFI Auto Money Management
MFI_RiskFactor1.0MFI Risk Money Management
MFI_ManualLotSize0.10MFI Manual Lot Size
MFI_UseRecoveryLotNot_Use_RecoveryMFI Use Recovery Lot Size After Losses
MFI_MultiRecoveryLot2.0MFI Multiplier For Recovery Lot Size
MS_StrategyRuntrueMS Strategy Run
MS_Fast_EMA_Period3MS MACD Fast EMA Period
MS_Slow_EMA_Period9MS MACD Slow EMA Period
MS_Signal_Period2MS MACD Signal Period
MS_K_Period5MS STOCH K Period
MS_D_Period3MS STOCH D Period
MS_Slowing_Period12MS STOCH Slowing Period
MS_OpenOrdersType_18MS Type Of Open Orders 1 (0=Not Use)(from 1 to 11)
MS_OpenOrdersType_222MS Type Of Open Orders 2 (0=Not Use)(from 1 to 28)
MS_LevelOpenOrders_160.0MS Level Open Orders 1
MS_LevelOpenOrders_280.0MS Level Open Orders 2
MS_CloseInSignalstrueMS Close Orders Via Signals
MS_CloseOrdersType_19MS Type Of Close Orders 1 (0=Not Use)(from 1 to 11)
MS_CloseOrdersType_210MS Type Of Close Orders 2 (0=Not Use)(from 1 to 28)
MS_LevelCloseOrders_150.0MS Level Close Orders 1
MS_LevelCloseOrders_265.0MS Level Close Orders 2
MS_TypeOfLevelsUseUse_Only_Virtual_LevelsMS Type Of Levels Use To Close Orders
MS_TakeProfit10.0MS Pips Take Profit (0=Not Use)
MS_StopLoss45.0MS Pips Stop Loss (0=Not Use)
MS_AutoLotSizetrueMS Auto Money Management
MS_RiskFactor1.0MS Risk Money Management
MS_ManualLotSize0.10MS Manual Lot Size
MS_UseRecoveryLotNot_Use_RecoveryMS Use Recovery Lot Size After Losses
MS_MultiRecoveryLot2.0MS Multiplier For Recovery Lot Size
MakeOrdersGridNot_Make_GridMake Grid Of Orders
PipsBetweenOrders0.0Pips Between Orders
TimeBetweenOrders60Seconds Between Orders
ControlSessiontrueUse Trade Control Session
WaitAfterOpen60Wait After Monday Open
StopBeforeClose60Stop Before Friday Close
ShowCommentstrueShow Comments On Chart
ColorOffLinesclrGrayColor Off Lines
ColorExpertNameclrDodgerBlueColor Expert Name
ColorSpreadInfoclrLightSkyBlueColor Spread Information
ColorMoneyMngmntclrLightBlueColor Money Management
ColorCurrentOrdersclrPaleTurquoiseColor Current Orders
ColorHistoryOrdersclrLightCyanColor History Orders
MaxSpread0.0Max Accepted Spread (0=Not Limit)
MaxOrders0Max Opened Orders (0=No Limit)
Slippage3Accepted Slippage
SoundAlertfalsePlay Sound Alerts
PrintOperationsfalsePrint Information Log
MagicNumber0Orders' ID (0=Generate Automatically)
InpTradeComment"Psgrowth.com Expert_12072"Orders' Comment
Source Code (.mq5)Open Source
Pipsgrowth_com_EX12072.mq5
#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.

Tags:ex12072multiindicatorconfluencepipsgrowthfreemt5xauusd

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

Community

Sign in to contributeSign In

Educational purposes only. Do NOT use with real money. Test on demo accounts only.

File NamePipsgrowth_com_EX12072.mq5
File Size309.7 KB
Versionv2.00
PlatformMetaTrader 5
File Type.mq5 Source
StrategyOther
Risk LevelMedium Risk
Timeframes
M5
Currency Pairs
XAUUSD
Min. Deposit$100