P
PipsGrowth
OtherOpen Source – Free

Pipsgrowth EX12073 MultiIndicatorConfluence

MT5 Expert Advisor (Open Source) · XAUUSD · M5

Pipsgrowth.com EX12073 MultiStrategyEA_v1_2 — Multi-strategy EA (AC+ADX+AO+DeM+FBB+MFI+MS), full 12-layer stack.

Overview

EX12073 is a seven-strategy parallel voting engine. Where most multi-indicator EAs blend a handful of oscillators into one consensus, EX12073 deploys seven independent signal pipelines — AC, ADX, AO, DeM, FBB, MFI, MS — each with its own indicator handle, its own TP and SL expressed in pips, its own lot calculator, its own recovery switch, and its own magic number for position tracking. Every pipeline runs on every bar close and the EA can either fire all of them at once or hold them back via a mutual-exclusion rule, depending on how you set TradeAllStrategies.

The seven sub-strategies map to nine native indicator handles. iAC and iAO are bare defaults. iADX uses 20 bars. iDeMarker uses 20 bars. The FBB sub-strategy is the only dual-indicator block: it pairs iBands(20, 0, 1.8, PRICE_CLOSE) with iForce(20, MODE_SMA, VOLUME_TICK). MFI is iMFI(12, VOLUME_TICK). The MS sub-strategy combines iMACD(3, 9, 2, PRICE_CLOSE) with iStochastic(5, 3, 12, MODE_SMA, STO_LOWHIGH). Each sub-strategy has its own *_GetSignals() function — AC_GetSignals(), ADX_GetSignals(), and so on through MS_GetSignals() — called from OnTick only when the current bar's open time differs from the previous tick's run, which keeps CPU usage flat during quiet ticks.

Each sub-strategy ships with a numeric signal-type selector and a level. AC and AO allow 8 signal types (0=disabled) with AC_LevelOpenOrders=80.0 and AC_LevelCloseOrders=70.0 versus AO_LevelOpenOrders=55.0 and AO_LevelCloseOrders=40.0. ADX, DeM, and MFI allow 4 signal types with paired entry and exit levels (e.g. ADX_LevelOpenOrders_1=55.0 / ADX_LevelOpenOrders_2=15.0). FBB and MS use a two-tier type/level scheme — FBB picks one type from 2 options for tier 1 and one from 8 for tier 2; MS picks one from 11 for tier 1 and one from 28 for tier 2. The OpenOrdersType and CloseOrdersType values are validated in OnInit: mismatched values abort the EA with INIT_FAILED, as do negative SL/TP, out-of-range RiskFactor, and an OpenOrdersType equal to CloseOrdersType when CloseInSignals is true.

TP and SL are per-sub-strategy, expressed in pips, and selected via a Levels enum that decides how the protective levels are stored. Use_Only_Hard_Levels writes them to the broker's stop orders; Use_Only_Virtual_Levels (the default) keeps them inside the EA and closes via CloseOrders() on threshold breach; Use_Hard_And_Virtual_Levels writes both. The defaults are wildly different per sub-strategy — AC trades 95-pip TP against 85-pip SL, ADX trades 35/70, AO trades 10/80, DeM trades 5/60, FBB trades 5/15, MFI trades 50/25, MS trades 10/45 — so any single backtest reflects a specific mix. Before any order is sent, the EA clamps each *_PipsStopLoss and *_PipsTakeProfit to the broker's SYMBOL_TRADE_STOPS_LEVEL via MathMax(input, StopLevel), and any user-set value that falls below the stop level triggers a MessageBox warning at startup.

Lot sizing is per-sub-strategy. Each block has its own *_AutoLotSize boolean, *_RiskFactor (validated to 0.01–100), and *_ManualLotSize (default 0.10). When AutoLotSize is on, CalcLots() is called once per pipeline using the live account equity and the configured risk factor; when off, the manual lot is sent as-is. Recovery is its own switch with three modes — Not_Use_Recovery (default), Use_Last_Closing (recover against the last closed P&L), and Use_Higher_Profits (recover against the all-time-best historical P&L) — with a *_MultiRecoveryLot=2.0 step that doubles the recovery lot when the previous trade closed negative.

The grid layer sits on top of every sub-strategy. MakeOrdersGrid is a four-way enum: Not_Make_Grid (single position per direction), Make_Grid_In_Loss (add positions if the latest is in drawdown by PipsBetweenOrders), Make_Grid_In_Profit (add positions if the latest is in profit by PipsBetweenOrders), and Make_Grid_Loss_And_Profit (either). The 60-second TimeBetweenOrders debounces new entries so the EA cannot chain more than one order per sub-strategy per minute. When TradeAllStrategies is false, opening an order in any sub-strategy blocks the other six — AC_SumOrders+AO_SumOrders+...==0 is the gate condition repeated in every block of MainFunction(). When TradeAllStrategies is true, all seven can hold positions simultaneously, but each keeps its own magic number (911355 / 11625 / 112981 / 991725 / 113881 / 13902379 / 9093355) so GetResultsCurrentOrders() can attribute them correctly.

Pair routing is unusual. PairToTrade defaults to TRADE_EURUSD_4, but a 28-pair Pair enum covers the majors, crosses, and yen pairs (EURUSD, GBPUSD, USDJPY, EURJPY, AUDNZD, CADCHF, CHFJPY, and so on through 28 entries). If you set PairToTrade=CHART_PAIR (value 0), the EA auto-detects the symbol from the chart at startup and reassigns TypeOfPair accordingly. The EA then forces the chart to the chosen symbol and g_TimeFrame via ChartSetSymbolPeriod(). The default g_TimeFrame resolves from TimeFrame=8 through the MapTimeframeInt switch — values 1–7 map to M1/D1, but 8 falls through to PERIOD_H1, so the EA will run H1 unless you dial the input back to 5.

Session control is mechanical and broker-aware. SymbolInfoSessionTrade() returns the broker's actual trading hours for each weekday; on Mondays the EA suppresses new orders for WaitAfterOpen=60 minutes after the open, and on Fridays it suppresses new orders StopBeforeClose=60 minutes before close. The market-open check spans all seven weekdays. The TypeOperation enum drives three global modes: Stand_by_Mode returns early before any trade logic, Normal_Operation is the live trading path, and Close_Immediately_All_Orders walks every sub-strategy and closes every open position before returning.

The visual layer is heavier than usual. ShowComments=true drops a background rectangle, then CommentScreen() builds a 19-row Com* object panel on the chart with the EA name, spread, money-management state, current open orders, and recent history. Six color inputs (ColorOffLines, ColorExpertName, ColorSpreadInfo, ColorMoneyMngmnt, ColorCurrentOrders, ColorHistoryOrders) customize the panel. The cleanup path in OnDeinit walks every Com* object plus the background and removes them; all nine indicator handles are released via IndicatorRelease() before the EA unloads.

Three retry helpers — TryClose_EX12073, TryClosePartial_EX12073, and TryModify_EX12073 — are declared but not threaded into MainFunction(), which uses CTrade directly. They exist for future wiring, so any third-party caller can rebroadcast close and modify requests on REQUOTE, TIMEOUT, PRICE_OFF, or PRICE_CHANGED with a short retry interval. This is the same pattern used in other EX12 EAs in the family. The headline file magic — MagicSet=22212073 — is reserved for the EA's overall identity, but per-position tracking uses the seven hard-coded magic IDs above so that GetResultsCurrentOrders() can isolate the positions that belong to each sub-strategy before applying per-pipeline state. MaxSpread=0 is the default (no spread filter) and MaxOrders=0 means no per-account order cap beyond whatever the broker imposes via ACCOUNT_LIMIT_ORDERS.

Strategy Deep Dive

The engine in EX12073 is a per-bar dispatcher: OnTick compares the current iTime of the symbol to LastTimeRunFunctions and only when a new bar opens does it call the seven *_GetSignals() functions in turn, each of which copies the indicator buffer for its own oscillator and decides whether to set the matching *_OpenBuy / *_OpenSell / *_CloseBuy / *_CloseSell boolean. MainFunction() then validates market-open via SymbolInfoSessionTrade() per weekday, blocks trades during the Monday WaitAfterOpen=60 and Friday StopBeforeClose=60 windows, checks MaxSpread, walks the seven per-sub-strategy state machines via GetResultsCurrentOrders() and GetResultsHistoryOrders(), applies the grid logic for the seven sub-strategies independently, applies the mutual-exclusion check when TradeAllStrategies=false, and finally dispatches OpenOrders() and CloseOrders() per sub-strategy magic. The chart panel is rebuilt every tick through CommentScreen() and the background rectangle is removed in OnDeinit along with the nine indicator handles via IndicatorRelease().

Entry Signal

EX12073 runs seven independent signal pipelines on every bar close: AC (Accelerator Oscillator) with AC_OpenOrdersType=5 and AC_LevelOpenOrders=80.0; ADX (20 bars) with ADX_OpenOrdersType=2 and dual level thresholds (55.0 / 15.0); AO with AO_OpenOrdersType=6 and AO_LevelOpenOrders=55.0; DeMarker (20 bars) with DeM_OpenOrdersType=3 and DeM_LevelOpenOrders=75.0; FBB pairing Bollinger Bands(20, 0, 1.8) with Force Index(20) via FBB_OpenOrdersType_1=1 + FBB_OpenOrdersType_2=8; MFI(12) with MFI_OpenOrdersType=3 and MFI_LevelOpenOrders=90.0; and MS combining MACD(3,9,2) with Stochastic(5,3,12) via MS_OpenOrdersType_1=8 + MS_OpenOrdersType_2=22. With TradeAllStrategies=true all seven can fire in parallel, each holding its own magic number; with TradeAllStrategies=false, any open order in one sub-strategy blocks the other six.

Exit Signal

Each sub-strategy exits independently using its own TP and SL expressed in pips and selected through the per-strategy Levels enum (Hard / Virtual / Both). Defaults: AC 95/85, ADX 35/70, AO 10/80, DeM 5/60, FBB 5/15, MFI 50/25, MS 10/45. With CloseInReverse=true (the default), the *_GetSignals() reverse direction fires *_CloseBuy / *_CloseSell flags which MainFunction() translates into CloseOrders() calls per magic number. The grid layer can also open additional positions when MakeOrdersGrid is set to Make_Grid_In_Loss / Make_Grid_In_Profit / Make_Grid_Loss_And_Profit and the price has moved PipsBetweenOrders against or in favour of the latest open.

Stop Loss

Stop-loss is configured per sub-strategy in pips, with Use_Only_Virtual_Levels as the default mode (kept inside the EA, enforced via CloseOrders() rather than a broker stop). The EA clamps every *_StopLoss to the broker's SYMBOL_TRADE_STOPS_LEVEL via MathMax at startup. There is no global portfolio drawdown cap — risk is bound by the per-sub-strategy MaxOrders aggregator and the 60-second TimeBetweenOrders debounce.

Take Profit

Take-profit is configured per sub-strategy in pips, defaulting to Use_Only_Virtual_Levels (EA-enforced, not broker-side). Per-strategy defaults: AC 95 pips, ADX 35, AO 10, DeM 5, FBB 5, MFI 50, MS 10. When AC_CloseInSignals / ADX_CloseInSignals / AO_CloseInSignals / etc. is true, the per-sub-strategy *_CloseOrdersType (e.g. AC_CloseOrdersType=1 against AC_LevelCloseOrders=70.0) fires a signal-based exit before the TP threshold is reached.

Best For

Minimum recommended balance: $100 on a low-spread ECN or RAW-spread account, with a sub-account dedicated to gold (XAUUSD) on M5. The seven sub-strategies are heavy on the M5 CPU — 9 native indicator handles refreshed per bar plus the per-sub-strategy state walk — so a VPS with sub-25ms ping to the broker is advisable. With TradeAllStrategies=true all seven can run side by side, so the effective capital requirement climbs sharply and $500–$1,000 is a more realistic live-trading floor; with TradeAllStrategies=false and grid disabled the EA behaves like a single-vote system and the $100 deposit level is workable. Session control is broker-aware, so a broker that publishes accurate Sunday/Monday/Friday session windows is required to make the ControlSession block behave.

Strategy Logic

Pipsgrowth EX12073 MultiIndicatorConfluence — Strategy Logic Analysis (from .mq5 source)

Family: MultiIndicatorConfluence Magic: 22212073 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 = 22212073 // ============================================================================================================================================================================================================================//

INPUT PARAMETERS (145 total across 29 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 Strategikes 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
  • [=== DeM Recovery Settings ===] FBB_StrategyRun = true // Enable FBB Strategy
  • [=== DeM Recovery Settings ===] FBB_BarsCalculate = 20 // FBB Bars to Calculate Signals
  • [=== DeM Recovery Settings ===] FBB_Deviation = 1.8 // FBB Bollinger Bands Deviation
  • [=== DeM Recovery Settings ===] FBB_OpenOrdersType_1 = 1 // FBB Entry Signal Type 1 (0=Disabled)(Range 1-2)
  • [=== DeM Recovery Settings ===] FBB_OpenOrdersType_2 = 8 // FBB Entry Signal Type 2 (0=Disabled)(Range 1-8)
  • [=== DeM Recovery Settings ===] FBB_LevelOpenOrders_1 = 0.0 // FBB Entry Level 1 (0=Disabled)
  • [=== DeM Recovery Settings ===] FBB_LevelOpenOrders_2 = 50.0 // FBB Entry Level 2
  • [=== DeM Recovery Settings ===] FBB_CloseInSignals = false // FBB Close Positions via Signals
  • [=== DeM Recovery Settings ===] FBB_CloseOrdersType_1 = 1 // FBB Exit Signal Type 1 (0=Disabled)(Range 1-2)
  • [=== DeM Recovery Settings ===] FBB_CloseOrdersType_2 = 4 // FBB Exit Signal Type 2 (0=Disabled)(Range 1-8)
  • [=== DeM Recovery Settings ===] FBB_LevelCloseOrders_1 = 40.0 // FBB Exit Level 1 (0=Disabled)
  • [=== DeM Recovery Settings ===] FBB_LevelCloseOrders_2 = 40.0 // FBB Exit Level 2
  • [=== DeM Recovery Settings ===] FBB_TypeOfLevelsUse = Use_Only_Virtual_Levels // FBB Level Type for Position Closure
  • [=== DeM Recovery Settings ===] FBB_TakeProfit = 5.0 // FBB Take Profit (pips, 0=Disabled)
  • [=== DeM Recovery Settings ===] FBB_StopLoss = 15.0 // FBB Stop Loss (pips, 0=Disabled)
  • [=== DeM Recovery Settings ===] FBB_AutoLotSize = true // FBB Enable Auto Money Management
  • [=== DeM Recovery Settings ===] FBB_RiskFactor = 1.0 // FBB Risk Management Factor
  • [=== DeM Recovery Settings ===] FBB_ManualLotSize = 0.10 // FBB Manual Lot Size
  • [=== DeM Recovery Settings ===] FBB_UseRecoveryLot = Not_Use_Recovery // FBB Recovery Lot After Losses
  • [=== DeM Recovery Settings ===] FBB_MultiRecoveryLot = 2.0 // FBB Recovery Lot Multiplier
  • [=== DeM Recovery Settings ===] MFI_StrategyRun = true // Enable MFI Strategy
  • [=== DeM Recovery Settings ===] MFI_BarsCalculate = 12 // MFI Bars to Calculate Signals
  • [=== DeM Recovery Settings ===] MFI_OpenOrdersType = 3 // MFI Entry Signal Type (0=Disabled)(Range 1-4)
  • [=== DeM Recovery Settings ===] MFI_LevelOpenOrders = 90.0 // MFI Entry Signal Level
  • [=== DeM Recovery Settings ===] MFI_CloseInSignals = true // MFI Close Positions via Signals
  • [=== DeM Recovery Settings ===] MFI_CloseOrdersType = 4 // MFI Exit Signal Type (0=Disabled)(Range 1-4)
  • [=== DeM Recovery Settings ===] MFI_LevelCloseOrders = 90.0 // MFI Exit Signal Level
  • [=== DeM Recovery Settings ===] MFI_TypeOfLevelsUse = Use_Only_Virtual_Levels // MFI Level Type for Position Closure
  • [=== DeM Recovery Settings ===] MFI_TakeProfit = 50.0 // MFI Take Profit (pips, 0=Disabled)
  • [=== DeM Recovery Settings ===] MFI_StopLoss = 25.0 // MFI Stop Loss (pips, 0=Disabled)
  • [=== DeM Recovery Settings ===] MFI_AutoLotSize = true // MFI Enable Auto Money Management
  • [=== DeM Recovery Settings ===] MFI_RiskFactor = 1.0 // MFI Risk Management Factor
  • [=== DeM Recovery Settings ===] MFI_ManualLotSize = 0.10 // MFI Manual Lot Size
  • [=== DeM Recovery Settings ===] MFI_UseRecoveryLot = Not_Use_Recovery // MFI Recovery Lot After Losses
  • [=== DeM Recovery Settings ===] MFI_MultiRecoveryLot = 2.0 // MFI Recovery Lot Multiplier
  • [=== DeM Recovery Settings ===] MS_StrategyRun = true // Enable MS Strategy
  • [=== DeM Recovery Settings ===] MS_Fast_EMA_Period = 3 // MS MACD Fast EMA Period
  • [=== DeM Recovery Settings ===] MS_Slow_EMA_Period = 9 // MS MACD Slow EMA Period
  • [=== DeM Recovery Settings ===] MS_Signal_Period = 2 // MS MACD Signal Period
  • [=== DeM Recovery Settings ===] MS_K_Period = 5 // MS Stochastic K Period
  • [=== DeM Recovery Settings ===] MS_D_Period = 3 // MS Stochastic D Period
  • [=== DeM Recovery Settings ===] MS_Slowing_Period = 12 // MS Stochastic Slowing Period
  • [=== DeM Recovery Settings ===] MS_OpenOrdersType_1 = 8 // MS Entry Signal Type 1 (0=Disabled)(Range 1-11)
  • [=== DeM Recovery Settings ===] MS_OpenOrdersType_2 = 22 // MS Entry Signal Type 2 (0=Disabled)(Range 1-28)
  • [=== DeM Recovery Settings ===] MS_LevelOpenOrders_1 = 60.0 // MS Entry Level 1
  • [=== DeM Recovery Settings ===] MS_LevelOpenOrders_2 = 80.0 // MS Entry Level 2
  • [=== DeM Recovery Settings ===] MS_CloseInSignals = true // MS Close Positions via Signals
  • [=== DeM Recovery Settings ===] MS_CloseOrdersType_1 = 9 // MS Exit Signal Type 1 (0=Disabled)(Range 1-11)
  • [=== DeM Recovery Settings ===] MS_CloseOrdersType_2 = 10 // MS Exit Signal Type 2 (0=Disabled)(Range 1-28)
  • [=== DeM Recovery Settings ===] MS_LevelCloseOrders_1 = 50.0 // MS Exit Level 1
  • [=== DeM Recovery Settings ===] MS_LevelCloseOrders_2 = 65.0 // MS Exit Level 2
  • [=== DeM Recovery Settings ===] MS_TypeOfLevelsUse = Use_Only_Virtual_Levels // MS Level Type for Position Closure
  • [=== DeM Recovery Settings ===] MS_TakeProfit = 10.0 // MS Take Profit (pips, 0=Disabled)
  • [=== DeM Recovery Settings ===] MS_StopLoss = 45.0 // MS Stop Loss (pips, 0=Disabled)
  • [=== DeM Recovery Settings ===] MS_AutoLotSize = true // MS Enable Auto Money Management
  • [=== DeM Recovery Settings ===] MS_RiskFactor = 1.0 // MS Risk Management Factor
  • [=== DeM Recovery Settings ===] MS_ManualLotSize = 0.10 // MS Manual Lot Size
  • [=== DeM Recovery Settings ===] MS_UseRecoveryLot = Not_Use_Recovery // MS Recovery Lot After Losses
  • [=== DeM Recovery Settings ===] MS_MultiRecoveryLot = 2.0 // MS Recovery Lot Multiplier
  • [=== 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_12073" // Orders' Comment
Pseudocode
// Pipsgrowth EX12073 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 Strategikes 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_StrategyRuntrueEnable FBB Strategy
FBB_BarsCalculate20FBB Bars to Calculate Signals
FBB_Deviation1.8FBB Bollinger Bands Deviation
FBB_OpenOrdersType_11FBB Entry Signal Type 1 (0=Disabled)(Range 1-2)
FBB_OpenOrdersType_28FBB Entry Signal Type 2 (0=Disabled)(Range 1-8)
FBB_LevelOpenOrders_10.0FBB Entry Level 1 (0=Disabled)
FBB_LevelOpenOrders_250.0FBB Entry Level 2
FBB_CloseInSignalsfalseFBB Close Positions via Signals
FBB_CloseOrdersType_11FBB Exit Signal Type 1 (0=Disabled)(Range 1-2)
FBB_CloseOrdersType_24FBB Exit Signal Type 2 (0=Disabled)(Range 1-8)
FBB_LevelCloseOrders_140.0FBB Exit Level 1 (0=Disabled)
FBB_LevelCloseOrders_240.0FBB Exit Level 2
FBB_TypeOfLevelsUseUse_Only_Virtual_LevelsFBB Level Type for Position Closure
FBB_TakeProfit5.0FBB Take Profit (pips, 0=Disabled)
FBB_StopLoss15.0FBB Stop Loss (pips, 0=Disabled)
FBB_AutoLotSizetrueFBB Enable Auto Money Management
FBB_RiskFactor1.0FBB Risk Management Factor
FBB_ManualLotSize0.10FBB Manual Lot Size
FBB_UseRecoveryLotNot_Use_RecoveryFBB Recovery Lot After Losses
FBB_MultiRecoveryLot2.0FBB Recovery Lot Multiplier
MFI_StrategyRuntrueEnable MFI Strategy
MFI_BarsCalculate12MFI Bars to Calculate Signals
MFI_OpenOrdersType3MFI Entry Signal Type (0=Disabled)(Range 1-4)
MFI_LevelOpenOrders90.0MFI Entry Signal Level
MFI_CloseInSignalstrueMFI Close Positions via Signals
MFI_CloseOrdersType4MFI Exit Signal Type (0=Disabled)(Range 1-4)
MFI_LevelCloseOrders90.0MFI Exit Signal Level
MFI_TypeOfLevelsUseUse_Only_Virtual_LevelsMFI Level Type for Position Closure
MFI_TakeProfit50.0MFI Take Profit (pips, 0=Disabled)
MFI_StopLoss25.0MFI Stop Loss (pips, 0=Disabled)
MFI_AutoLotSizetrueMFI Enable Auto Money Management
MFI_RiskFactor1.0MFI Risk Management Factor
MFI_ManualLotSize0.10MFI Manual Lot Size
MFI_UseRecoveryLotNot_Use_RecoveryMFI Recovery Lot After Losses
MFI_MultiRecoveryLot2.0MFI Recovery Lot Multiplier
MS_StrategyRuntrueEnable MS Strategy
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 Stochastic K Period
MS_D_Period3MS Stochastic D Period
MS_Slowing_Period12MS Stochastic Slowing Period
MS_OpenOrdersType_18MS Entry Signal Type 1 (0=Disabled)(Range 1-11)
MS_OpenOrdersType_222MS Entry Signal Type 2 (0=Disabled)(Range 1-28)
MS_LevelOpenOrders_160.0MS Entry Level 1
MS_LevelOpenOrders_280.0MS Entry Level 2
MS_CloseInSignalstrueMS Close Positions via Signals
MS_CloseOrdersType_19MS Exit Signal Type 1 (0=Disabled)(Range 1-11)
MS_CloseOrdersType_210MS Exit Signal Type 2 (0=Disabled)(Range 1-28)
MS_LevelCloseOrders_150.0MS Exit Level 1
MS_LevelCloseOrders_265.0MS Exit Level 2
MS_TypeOfLevelsUseUse_Only_Virtual_LevelsMS Level Type for Position Closure
MS_TakeProfit10.0MS Take Profit (pips, 0=Disabled)
MS_StopLoss45.0MS Stop Loss (pips, 0=Disabled)
MS_AutoLotSizetrueMS Enable Auto Money Management
MS_RiskFactor1.0MS Risk Management Factor
MS_ManualLotSize0.10MS Manual Lot Size
MS_UseRecoveryLotNot_Use_RecoveryMS Recovery Lot After Losses
MS_MultiRecoveryLot2.0MS Recovery Lot Multiplier
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_12073"Orders' Comment
Source Code (.mq5)Open Source
Pipsgrowth_com_EX12073.mq5
#property copyright "Pipsgrowth.com"
#property link      "https://pipsgrowth.com"
#property version   "2.00"
#property strict
#property description "Pipsgrowth.com EX12073 MultiStrategyEA_v1_2 — Multi-strategy EA (AC+ADX+AO+DeM+FBB+MFI+MS), full 12-layer stack."
#include <Trade\Trade.mqh>
//============================================================================================================================================================================================================================//
#define MagicSet 22212073
//============================================================================================================================================================================================================================//
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
            };
//============================================================================================================================================================================================================================//
//Common 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:ex12073multiindicatorconfluencepipsgrowthfreemt5xauusd

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_EX12073.mq5
File Size303.2 KB
Versionv2.00
PlatformMetaTrader 5
File Type.mq5 Source
StrategyOther
Risk LevelMedium Risk
Timeframes
M5
Currency Pairs
XAUUSD
Min. Deposit$100