Pipsgrowth EX12070 MultiIndicatorConfluence
MT5 Expert Advisor (Open Source) · XAUUSD · M5, H1
Pipsgrowth.com EX12070 Multi_Indicator_EA — Multi-indicator confluence (Ichimoku+MACD+RSI), full 12-layer stack.
Overview
Pipsgrowth EX12070 is the full, production-tier build of the MultiIndicatorConfluence stack — a 131-input confluence engine that wires three independent Ichimoku clouds, three MACD oscillators and three RSI oscillators across configurable timeframes, and then requires them to vote together before a position is allowed through the gate. The EA was designed for traders who want one chart, one process, and one set of decisions, but who also want the analyst-grade flexibility to set a short-term Ichimoku against a slow MACD against a medium RSI and have the system reconcile them. The default footprint is XAUUSD M5 with a recommended account from $100, but the symbol, the timeframes per indicator, the lot sizing, the entry voting rule, the confirmation voting rule, the breakeven, the dynamic profit lock, the drawdown cap, and the consecutive-loss cooldown are all inputs — none of them hard-coded in any way that you cannot override.
Entry logic is structured as a two-tier vote. The first tier, signals, is produced by crossover-style logic on each enabled indicator: an Ichimoku counts as a buy signal when its Tenkan-sen crosses above the Kijun-sen on bar 1 (a fresh cross), a MACD counts as a buy signal when its main line crosses above its signal line on bar 1, and an RSI counts as a buy signal when it crosses up out of the oversold zone on bar 1. The second tier, confirmations, is produced by the same indicators but read as a state: Ichimoku confirms a buy when the close of bar 1 is above the cloud (max of Senkou Span A and B), MACD confirms a buy when its main line is above zero on bar 1, and RSI confirms a buy when it is above 50 on bar 1. Both tiers are tallied per indicator and then passed through two independent switches: EntryMethod (default ENTRY_ALL_ENABLED, requiring all enabled indicators to fire a signal) and ConfirmationMethod (default CONFIRM_ALL_ENABLED, requiring all enabled indicators to confirm). The combination is what ShouldOpenBuy() and ShouldOpenSell() test before any order is sent, so on a default install the system only opens when every enabled Ichimoku, every enabled MACD and every enabled RSI is simultaneously crossing and confirming in the same direction.
The indicator count is not fixed. Each of the three Ichimoku clouds, the three MACDs and the three RSIs has its own Enable flag and its own per-instance timeframe input (1=M1, 2=M5, 3=M15, 4=M30, 5=H1, 6=H4, 7=D1), so you can run a slow 26-52 Ichimoku on H4 against a fast 12-26-9 MACD on H1 and a 14-period RSI on M30 from the same EA. The defaults are 9-26-52 Ichimoku on H1 (TF=8 maps to H1), 12-26-9 MACD on H4 (TF=6), 14-period RSI on H4 (TF=6), and ATR(14) on the chart timeframe (TF=0). The GetEnabledIndicatorCount() helper returns the running count of EnableX flags, and that count is the denominator that ENTRY_ALL_ENABLED and CONFIRM_ALL_ENABLED compare against — so the strictness of the system scales with how many indicators you switch on. A trader who enables only two indicators and uses ENTRY_MIN_REQUIRED = 1 and CONFIRM_ANY_CONFIRMATION will see a much more permissive system than the stock install.
Stop loss and take profit are both volatility-aware and both have a fallback. The primary path is the ATR-based stop: CalculateStopLoss() and CalculateTakeProfit() read the ATR(14) and multiply it by ATR_MultiplierSL (default 1.2) for the stop and ATR_MultiplierTP (default 1.5) for the take, so the default R:R on a volatility-scaled entry is 1:1.25. The fallback is HardSL_Points = 120 and HardTP_Points = 180, used only when ATR cannot be read, and that fixed path gives a 1:1.5 R:R. There is a third layer: when both ATR SL and the dynamic profit lock are active, the SLResolve enum (SL_SYSTEM_DECIDE, SL_USE_ATR, SL_USE_DYNAMIC_LOCK) decides which one the system applies per ticket. Lot sizing is also three-way: LOT_FIXED (0.10 lot default), LOT_PER_BALANCE (lots = balance / 2000), or LOT_RISK_PERCENTAGE (1.0% of equity, divided by the ATR-implied SL distance, in a 5-digit-broker math model).
Once a trade is open, ManagePositions() runs every tick. It calls CheckBreakeven() first: when price has moved 30 points in profit, the SL is ratcheted to entry plus 5 points (or exactly entry if BreakevenLockPoints = 0). It then calls CheckDynamicProfitLock(): when floating profit exceeds LockProfitEvery_X_Dollars ($2 by default), the SL is moved to lock all but LockMinusBuffer ($1 by default) of the current price distance from entry. The result is a trade that, after a small initial float, becomes impossible to lose. CheckOppositeSignalClosure() is the third management layer: if a fresh analysis of the indicators now produces an opposite signal that satisfies ShouldOpenBuy/ShouldOpenSell, the position is closed via TryClose_EX12070. All three modify/close paths use the 3-attempt retry wrapper that catches TRADE_RETCODE_REQUOTE, _TIMEOUT, _PRICE_OFF and _PRICE_CHANGED with a 100–200 ms sleep between attempts — a deliberate speed-vs-reliability compromise for fast gold tickers.
The risk stack has three independent guards. CheckDrawdownProtection() compares the current equity to the equity recorded at OnInit; when the drop exceeds MaxDrawdownPercent (10% by default) and DrawdownStopTrading is on, the EA stops opening new trades, and if DrawdownCloseAll is on, it also liquidates the book via CloseAllPositions(). If drawdown is past 50% of the cap and DrawdownReduceLots is on, CalculateLotSize() multiplies the next lot by DrawdownLotReduction (0.5 by default), halving exposure before the hard cap. CheckConsecutiveLossProtection() watches the OnTradeTransaction callback: after MaxConsecutiveLosses losing deals (3 by default), the EA sets pauseUntil to now + LossProtection_PauseMinutes * 60 and refuses to enter for the duration. There is also a configurable recovery path — LossProtection_ReduceLotSize halves the next lot for every loss past LotReduction_AfterLosses (2), and LossProtection_IncreaseSL widens the next SL by SL_Increase_Factor (1.5x) per loss, capped at SL_Increase_MaxMultiplier (2.0x). Both are off by default because the EA assumes a trending market on the default install; turning them on is the conservative path.
Three session windows gate the entry path, controlled by the === Trading Sessions === group. The default install has session filtering disabled (EnableSessionFilter = false), so the EA trades 24 hours, but the wiring for up to three independent windows is in place. Session 1 is pre-set to 08:00–17:00 (London + New York cash sessions on a GMT+0/GMT+2 broker), Session 2 to 18:00–23:59 (the New York afternoon / late NY), and Session 3 to 00:00–07:59 (Asia). IsWithinTradingSession() checks each session in order, and a session that crosses midnight is handled as an overnight window — so a 22:00–06:00 window would also work without code changes. MinBarsBetweenTrades = 1 and OneTradePerSignal = true add a second throttle: only one entry per bar, and at least one bar of separation between entries, which prevents the same signal from re-firing on every tick of a five-minute candle.
The chart footprint is small by design: ShowIndicatorsOnChart = true will draw all enabled Ichimoku clouds, MACD histograms and RSI panels on the chart, and ShowOrderExecutionLines = true will drop a dotted vertical line at every buy (blue) and sell (red) execution. The trade comment is built from InpTradeComment + PresetNumber + direction, so a backtest journal is searchable by EA name. The display layer is the only thing that costs CPU — VerboseLogging and DebugSignalDetails are both off by default and should stay off during forward runs because they print on every confirmed bar. EvaluateOnNewBar = true is the other major performance switch: it short-circuits OnTick() when the current bar has not yet closed, which on M5 means the bulk of the analysis runs twelve times an hour rather than thousands of times a minute. With all three indicators per category enabled, the EA holds ten native indicator handles (ichimoku1_handle through ichimoku3_handle, macd1_handle through macd3_handle, rsi1_handle through rsi3_handle, plus atr_handle); disabling categories you do not need is the single biggest CPU saving you can make on this build.
In practice this EA rewards a slow-input user more than a fast-input user. The default install — 10 indicators all on, all-enable entry, all-enable confirmations, breakeven at +30, lock at +$2, hard cap 10% — is a high-conviction, low-trade-count system. Trimming inputs to two Ichimoku and one MACD on H1, switching to ENTRY_MIN_REQUIRED = 2 and CONFIRM_MIN_REQUIRED = 1, and turning on LossProtection_RestrictTrading = true would produce a different EA entirely: more trades, tighter SL, and a pause after any losing streak. Both modes are valid; what is not valid is changing the indicator handles and not changing MinRequiredEntries to match.
Strategy Deep Dive
On every new bar of the chart timeframe, OnTick() runs through five gates in order: IsNewBar(), IsWithinTradingSession(), CheckDrawdownProtection(), CheckConsecutiveLossProtection(), and ManagePositions() — only then does AnalyzeSignals() poll all ten indicator handles and tally the per-direction vote. Each enabled Ichimoku contributes one buy/sell signal from a Tenkan/Kijun cross and one buy/sell confirmation from price-vs-cloud state; each MACD contributes one signal from a main/signal cross and one confirmation from sign-of-main-line; each RSI contributes one signal from an oversold/overbought cross and one confirmation from above/below 50. The two ENUM_ENTRY_METHOD and ENUM_CONFIRMATION_METHOD switches apply to the tallied counts inside ShouldOpenBuy() and ShouldOpenSell(), and only when both switch tests pass does the EA call CalculateLotSize() (which folds in any active drawdown or consecutive-loss lot reduction) and OpenBuyTrade/OpenSellTrade.
Entry fires when both voting tiers agree. The signal tier counts crossovers (Tenkan>Kijun cross, MACD main>signal cross, RSI cross up out of oversold), and the confirmation tier counts state reads (price above Ichimoku cloud, MACD main>0, RSI>50). With EntryMethod = ENTRY_ALL_ENABLED and ConfirmationMethod = CONFIRM_ALL_ENABLED (the defaults), every enabled indicator must produce both a fresh cross and a state confirmation in the same direction on bar 1 before a buy or sell ticket is sent.
Exits run on three paths. CheckOppositeSignalClosure() closes the position when a fresh re-analysis of the indicators now produces the opposite signal that satisfies ShouldOpenBuy/ShouldOpenSell. CheckBreakeven() ratchets the stop to entry+5 points after 30 points of profit, and CheckDynamicProfitLock() moves the stop to lock all but $1 of the current price distance once floating profit exceeds $2. The hard TP of 180 points or the ATR-scaled TP of 1.5x ATR runs as a server-side target.
Stop loss is ATR(14) * 1.2 from the entry price (default), with a hard fallback of 120 points. The ATR path is active by default and re-evaluated per trade. When the floating profit reaches 30 points, the SL is moved to entry+5 points via CheckBreakeven(); when floating profit exceeds $2, the SL is moved to lock all but $1 of the price distance via CheckDynamicProfitLock().
Take profit is ATR(14) * 1.5 from entry (default), with a hard fallback of 180 points (1:1.5 R:R against the 120-point hard stop). The system can be switched to a strict ATR-only path, a strict points-only path, or the system-decides path via enableATR_TP and HardTP_Points. Once a position is open, the active TP is the server-side target, and the SL ratchet and profit lock protect the unrealized gains.
Recommended minimum balance $100 on a low-spread ECN broker, XAUUSD M5, with the default 10-indicator all-enabled vote for low-trade-count swing systems. The per-indicator timeframe inputs let you re-target the same code to H1/H4 swing trading on FX majors (EURUSD, GBPUSD, USDJPY) without recompiling — disable two of the three Ichimoku clouds and two of the three MACDs first, because the 10-handle indicator load on M5 is the most likely source of CPU lag. For 24-hour use, leave EnableSessionFilter = false; to focus on London + New York cash, set Session1_Enable = true (08:00–17:00) and disable the other two sessions.
Strategy Logic
Pipsgrowth EX12070 MultiIndicatorConfluence — Strategy Logic Analysis (from .mq5 source)
Family: MultiIndicatorConfluence
Magic: 22212070
Version: 2.00
BRIEF:
Production-ready multi-indicator EA using Ichimoku, MACD, RSI across timeframes with confluence entry logic, ATR SL/TP, dynamic profit lock, breakeven and consecutive loss protection. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
InitializeIndicators()ReleaseIndicators()IsNewBar()IsWithinTradingSession()CheckDrawdownProtection()CheckConsecutiveLossProtection()AnalyzeIchimokuSignals()AnalyzeMACDSignals()AnalyzeRSISignals()ShouldOpenBuy()ShouldOpenSell()GetEnabledIndicatorCount()- ...and 20 more
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (131 total across 14 groups):
- [=== Lot Sizing Settings ===]
LotSizingMethod=LOT_FIXED// Lot sizing method - [=== Lot Sizing Settings ===] Lots =
0.1// Fixed lot size (used when method = Fixed) - [=== Lot Sizing Settings ===]
BalancePerLot=2000.0// Balance required per lot (used when method = Per Balance) - [=== Lot Sizing Settings ===]
RiskPercent=1.0// Risk percentage (used when method = Risk Percentage) - [=== Lot Sizing Settings ===]
MinLotSize=0.01// Minimum lot size (for Balance/Risk methods) - [=== Lot Sizing Settings ===]
MaxLotSize=10.0// Maximum lot size (for Balance/Risk methods) - [=== Additional Trades ===]
OneTradeOnly=true// Allow only one trade per symbol - [=== Additional Trades ===]
MaxOpenTrades= 5 // Maximum allowed open trades - [=== Additional Trades ===]
AllowOnlyProfitableAdditions=true// Only add positions when existing are profitable - [=== Additional Trades ===]
MinProfitPerTradeToAdd=5.0// Minimum profit required per trade to add new position - [=== Additional Trades ===]
MinBarsBetweenTrades= 1 // Minimum bars between new trades (0=no limit) - [=== Additional Trades ===]
OneTradePerSignal=true// Only one trade per signal bar - [=== Trade Settings ===]
AllowBuy=true// AllowBUY - [=== Trade Settings ===]
AllowSell=true// AllowSELL - [=== Trade Settings ===]
MagicNumber=22212070// Magic Number - [=== Trade Settings ===]
InpTradeComment= "Psgrowth.com Expert_12070" // TradeComment - [=== Trade Settings ===]
AdditionalTradeCommentPrefix= "Add" // Additional trades prefix - [=== Trade Settings ===]
PresetNumber= "1" // Preset number to add to trade comments - [=== Trade Settings ===]
ShowOrderExecutionLines=true// Show vertical lines on order execution - [=== Trade Settings ===]
ShowIndicatorsOnChart=true// Show indicators on chart - [=== Initial SL/TP ===]
HardSL_Points= 120 // Hard stop loss in points - [=== Initial SL/TP ===]
HardTP_Points= 180 // Hard take profit in points - [=== SL ===]
enableATR_SL=true// EnableATR-based stop loss - [=== SL ===] ATR_MultiplierSL =
1.2//ATRmultiplier for stop loss - [=== SL ===]
enableATR_TP=true// EnableATR-based take profit - [=== SL ===] ATR_MultiplierTP =
1.5//ATRmultiplier for take profit - [=== SL ===] SLResolve =
SL_SYSTEM_DECIDE// Resolution when bothATRSL & Dynamic Lock Profit are active - [=== Profit Lock Settings ===]
EnableDynamicLockProfit=true// Enable dynamic profit locking - [=== Profit Lock Settings ===]
LockProfitEvery_X_Dollars=2.0// Lock profit at every X dollars - [=== Profit Lock Settings ===]
LockMinusBuffer=1.0// Buffer amount subtracted from locked profit - [=== Breakeven Settings ===]
EnableBreakeven=true// Enable automatic breakeven - [=== Breakeven Settings ===]
BreakevenActivatePoints=30.0// Points profit to activate breakeven - [=== Breakeven Settings ===]
BreakevenLockPoints=5.0// Points above entry to setSL(0 = exact entry) - [=== Breakeven Settings ===]
BreakevenOncePerTrade=true// Only move to breakeven once per trade - [=== Risk Management Settings ===]
MaxDrawdownPercent=10.0// Maximum allowed drawdown percentage - [=== Risk Management Settings ===]
EnableDrawdownProtection=true// Enable drawdown protection system - [=== Risk Management Settings ===]
DrawdownStopTrading=true// Stop new trades when max drawdown reached - [=== Risk Management Settings ===]
DrawdownCloseAll=false// Close all positions when max drawdown reached - [=== Risk Management Settings ===]
DrawdownReduceLots=true// Reduce lot sizes as drawdown increases - [=== Risk Management Settings ===]
DrawdownLotReduction=0.5// Lot reduction factor at 50% of max drawdown - [=== Risk Management Settings ===]
DrawdownWarningPercent=7.5// Warning threshold (% of equity) - [=== Risk Management Settings ===]
DrawdownAlertEnabled=true// Send alerts when drawdown limits reached - [=== Risk Management Settings ===]
DrawdownUseBalance=false// Use balance instead of equity for drawdown calculation - [=== Risk Management Settings ===]
MaxSlippage= 10 // Maximum allowed slippage in points - [=== Risk Management Settings ===]
CloseOnOppositeSignal=true// Close positions on opposite signal - [=== Consecutive Loss Protection ===]
EnableConsecutiveLossProtection=false// Enable consecutive loss protection system - [=== Consecutive Loss Protection ===]
MaxConsecutiveLosses= 3 // Maximum consecutive losses allowed - [=== Consecutive Loss Protection ===]
LossProtection_PauseMinutes= 60 // Trading pause duration (minutes) after max losses - [=== Consecutive Loss Protection ===]
LossProtection_ReduceLotSize=true// Reduce lot size after consecutive losses - [=== Consecutive Loss Protection ===]
LotReduction_Factor=0.5// Lot reduction factor (0.1-1.0, e.g.,0.5= 50% reduction) - [=== Consecutive Loss Protection ===]
LotReduction_AfterLosses= 2 // Start reducing lot size after X consecutive losses - [=== Consecutive Loss Protection ===]
LotReduction_MinSize=0.01// Minimum lot size when reducing - [=== Consecutive Loss Protection ===]
LossProtection_IncreaseSL=false// Increase stop loss after consecutive losses - [=== Consecutive Loss Protection ===] SL_Increase_Factor =
1.5// SL increase factor (e.g.,1.5= 50% larger SL) - [=== Consecutive Loss Protection ===] SL_Increase_AfterLosses = 2 // Start increasing SL after X consecutive losses
- [=== Consecutive Loss Protection ===] SL_Increase_MaxMultiplier =
2.0// Maximum SL multiplier - [=== Consecutive Loss Protection ===]
LossProtection_RestrictTrading=true// Restrict trading to higher probability setups - [=== Consecutive Loss Protection ===]
LossProtection_OnlyTrendSignals=false// Only take trend-following signals after losses - [=== Consecutive Loss Protection ===]
LossProtection_RequireConfirmation=true// Require signal confirmation after consecutive losses - [=== Consecutive Loss Protection ===]
LossProtection_ResetAfterWin= 1 // Reset consecutive loss count after X wins - [=== Consecutive Loss Protection ===]
LossProtection_ShowWarnings=true// Display consecutive loss warnings on chart - [=== Trading Sessions ===]
EnableSessionFilter=false// Enable trading session filtering - [=== Trading Sessions ===] Session1_Enable =
true// Enable Session 1 - [=== Trading Sessions ===] Session1_StartHour = 8 // Session 1: Start
Hour(0-23) - [=== Trading Sessions ===] Session1_StartMinute = 0 // Session 1: Start
Minute(0-59) - [=== Trading Sessions ===] Session1_EndHour = 17 // Session 1: End
Hour(0-23) - [=== Trading Sessions ===] Session1_EndMinute = 0 // Session 1: End
Minute(0-59) - [=== Trading Sessions ===] Session2_Enable =
false// Enable Session 2 - [=== Trading Sessions ===] Session2_StartHour = 18 // Session 2: Start
Hour(0-23) - [=== Trading Sessions ===] Session2_StartMinute = 0 // Session 2: Start
Minute(0-59) - [=== Trading Sessions ===] Session2_EndHour = 23 // Session 2: End
Hour(0-23) - [=== Trading Sessions ===] Session2_EndMinute = 59 // Session 2: End
Minute(0-59) - [=== Trading Sessions ===] Session3_Enable =
false// Enable Session 3 - [=== Trading Sessions ===] Session3_StartHour = 0 // Session 3: Start
Hour(0-23) - [=== Trading Sessions ===] Session3_StartMinute = 0 // Session 3: Start
Minute(0-59) - [=== Trading Sessions ===] Session3_EndHour = 7 // Session 3: End
Hour(0-23) - [=== Trading Sessions ===] Session3_EndMinute = 59 // Session 3: End
Minute(0-59) - [=== Trading Sessions ===]
EntryMethod=ENTRY_ALL_ENABLED// Entry signal requirement method - [=== Trading Sessions ===]
MinRequiredEntries= 2 // Minimum entries required (when usingENTRY_MIN_REQUIRED) - [=== Trading Sessions ===]
ConfirmationMethod=CONFIRM_ALL_ENABLED// Confirmation filter requirement method - [=== Trading Sessions ===]
MinRequiredConfirmations= 1 // Minimum confirmations required (when usingCONFIRM_MIN_REQUIRED) - [=== Trading Sessions ===]
EvaluateOnNewBar=true// Only evaluate new entries on new bar (FASTERfor backtesting) - [=== Trading Sessions ===]
VerboseLogging=false// Detailed print logs (DISABLEfor faster backtesting) - [=== Trading Sessions ===]
DebugSignalDetails=false// Extra debug verbosity (DISABLEfor faster backtesting) - [=== Ichimoku Cloud Indicators ===]
EnableIchimoku1=true// Enable Ichimoku 1 - [=== Ichimoku Cloud Indicators ===] Ichimoku1_TF = 8 //
Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Ichimoku 1 Timeframe - [=== Ichimoku Cloud Indicators ===] Ichimoku1_Tenkan = 9 // Ichimoku 1 Tenkan-sen
- [=== Ichimoku Cloud Indicators ===] Ichimoku1_Kijun = 26 // Ichimoku 1 Kijun-sen
- [=== Ichimoku Cloud Indicators ===] Ichimoku1_Senkou = 52 // Ichimoku 1 Senkou Span B
- [=== Ichimoku Cloud Indicators ===]
EnableIchimoku2=true// Enable Ichimoku 2 - [=== Ichimoku Cloud Indicators ===] Ichimoku2_TF = 9 //
Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Ichimoku 2 Timeframe - [=== Ichimoku Cloud Indicators ===] Ichimoku2_Tenkan = 9 // Ichimoku 2 Tenkan-sen
- [=== Ichimoku Cloud Indicators ===] Ichimoku2_Kijun = 26 // Ichimoku 2 Kijun-sen
- [=== Ichimoku Cloud Indicators ===] Ichimoku2_Senkou = 52 // Ichimoku 2 Senkou Span B
- [=== Ichimoku Cloud Indicators ===]
EnableIchimoku3=true// Enable Ichimoku 3 - [=== Ichimoku Cloud Indicators ===] Ichimoku3_TF = 10 //
Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Ichimoku 3 Timeframe - [=== Ichimoku Cloud Indicators ===] Ichimoku3_Tenkan = 9 // Ichimoku 3 Tenkan-sen
- [=== Ichimoku Cloud Indicators ===] Ichimoku3_Kijun = 26 // Ichimoku 3 Kijun-sen
- [=== Ichimoku Cloud Indicators ===] Ichimoku3_Senkou = 52 // Ichimoku 3 Senkou Span B
- [===
MACDIndicators ===]EnableMACD1=true// EnableMACD1 - [===
MACDIndicators ===]MACD1_TF= 6 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //MACD1 Timeframe - [===
MACDIndicators ===] MACD1_FastEMA = 12 //MACD1 FastEMA - [===
MACDIndicators ===] MACD1_SlowEMA = 26 //MACD1 SlowEMA - [===
MACDIndicators ===] MACD1_SignalSMA = 9 //MACD1 SignalSMA - [===
MACDIndicators ===]EnableMACD2=true// EnableMACD2 - [===
MACDIndicators ===]MACD2_TF= 8 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //MACD2 Timeframe - [===
MACDIndicators ===] MACD2_FastEMA = 12 //MACD2 FastEMA - [===
MACDIndicators ===] MACD2_SlowEMA = 26 //MACD2 SlowEMA - [===
MACDIndicators ===] MACD2_SignalSMA = 9 //MACD2 SignalSMA - [===
MACDIndicators ===]EnableMACD3=true// EnableMACD3 - [===
MACDIndicators ===]MACD3_TF= 9 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //MACD3 Timeframe - [===
MACDIndicators ===] MACD3_FastEMA = 12 //MACD3 FastEMA - [===
MACDIndicators ===] MACD3_SlowEMA = 26 //MACD3 SlowEMA - [===
MACDIndicators ===] MACD3_SignalSMA = 9 //MACD3 SignalSMA - [===
RSIIndicators ===]EnableRSI1=true// EnableRSI1 - [===
RSIIndicators ===]RSI1_TF= 6 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //RSI1 Timeframe - [===
RSIIndicators ===] RSI1_Period = 14 //RSI1 Period - [===
RSIIndicators ===] RSI1_Overbought =70.0//RSI1 Overboughtlevel - [===
RSIIndicators ===] RSI1_Oversold =30.0//RSI1 Oversoldlevel - [===
RSIIndicators ===]EnableRSI2=true// EnableRSI2 - [===
RSIIndicators ===]RSI2_TF= 8 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //RSI2 Timeframe - [===
RSIIndicators ===] RSI2_Period = 14 //RSI2 Period - [===
RSIIndicators ===] RSI2_Overbought =70.0//RSI2 Overboughtlevel - [===
RSIIndicators ===] RSI2_Oversold =30.0//RSI2 Oversoldlevel - [===
RSIIndicators ===]EnableRSI3=true// EnableRSI3 - [===
RSIIndicators ===]RSI3_TF= 9 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //RSI3 Timeframe - [===
RSIIndicators ===] RSI3_Period = 14 //RSI3 Period - [===
RSIIndicators ===] RSI3_Overbought =70.0//RSI3 Overboughtlevel - [===
RSIIndicators ===] RSI3_Oversold =30.0//RSI3 Oversoldlevel - [===
ATRSettings ===]ATR_TF= 0 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //ATRTimeframe - [===
ATRSettings ===] ATR_Period = 14 //ATRPeriod
// Pipsgrowth EX12070 MultiIndicatorConfluence — Execution Flow (from source analysis)
// Family: MultiIndicatorConfluence
// Production-ready multi-indicator EA using Ichimoku, MACD, RSI across timeframes with confluence entry logic, ATR SL/TP, dynamic profit lock, breakeven and consecutive loss protection. 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 |
|---|---|---|
| LotSizingMethod | LOT_FIXED | Lot sizing method |
| Lots | 0.1 | Fixed lot size (used when method = Fixed) |
| BalancePerLot | 2000.0 | Balance required per lot (used when method = Per Balance) |
| RiskPercent | 1.0 | Risk percentage (used when method = Risk Percentage) |
| MinLotSize | 0.01 | Minimum lot size (for Balance/Risk methods) |
| MaxLotSize | 10.0 | Maximum lot size (for Balance/Risk methods) |
| OneTradeOnly | true | Allow only one trade per symbol |
| MaxOpenTrades | 5 | Maximum allowed open trades |
| AllowOnlyProfitableAdditions | true | Only add positions when existing are profitable |
| MinProfitPerTradeToAdd | 5.0 | Minimum profit required per trade to add new position |
| MinBarsBetweenTrades | 1 | Minimum bars between new trades (0=no limit) |
| OneTradePerSignal | true | Only one trade per signal bar |
| AllowBuy | true | Allow BUY |
| AllowSell | true | Allow SELL |
| MagicNumber | 22212070 | Magic Number |
| InpTradeComment | "Psgrowth.com Expert_12070" | Trade Comment |
| AdditionalTradeCommentPrefix | "Add" | Additional trades prefix |
| PresetNumber | "1" | Preset number to add to trade comments |
| ShowOrderExecutionLines | true | Show vertical lines on order execution |
| ShowIndicatorsOnChart | true | Show indicators on chart |
| HardSL_Points | 120 | Hard stop loss in points |
| HardTP_Points | 180 | Hard take profit in points |
| enableATR_SL | true | Enable ATR-based stop loss |
| ATR_MultiplierSL | 1.2 | ATR multiplier for stop loss |
| enableATR_TP | true | Enable ATR-based take profit |
| ATR_MultiplierTP | 1.5 | ATR multiplier for take profit |
| SLResolve | SL_SYSTEM_DECIDE | Resolution when both ATR SL & Dynamic Lock Profit are active |
| EnableDynamicLockProfit | true | Enable dynamic profit locking |
| LockProfitEvery_X_Dollars | 2.0 | Lock profit at every X dollars |
| LockMinusBuffer | 1.0 | Buffer amount subtracted from locked profit |
| EnableBreakeven | true | Enable automatic breakeven |
| BreakevenActivatePoints | 30.0 | Points profit to activate breakeven |
| BreakevenLockPoints | 5.0 | Points above entry to set SL (0 = exact entry) |
| BreakevenOncePerTrade | true | Only move to breakeven once per trade |
| MaxDrawdownPercent | 10.0 | Maximum allowed drawdown percentage |
| EnableDrawdownProtection | true | Enable drawdown protection system |
| DrawdownStopTrading | true | Stop new trades when max drawdown reached |
| DrawdownCloseAll | false | Close all positions when max drawdown reached |
| DrawdownReduceLots | true | Reduce lot sizes as drawdown increases |
| DrawdownLotReduction | 0.5 | Lot reduction factor at 50% of max drawdown |
| DrawdownWarningPercent | 7.5 | Warning threshold (% of equity) |
| DrawdownAlertEnabled | true | Send alerts when drawdown limits reached |
| DrawdownUseBalance | false | Use balance instead of equity for drawdown calculation |
| MaxSlippage | 10 | Maximum allowed slippage in points |
| CloseOnOppositeSignal | true | Close positions on opposite signal |
| EnableConsecutiveLossProtection | false | Enable consecutive loss protection system |
| MaxConsecutiveLosses | 3 | Maximum consecutive losses allowed |
| LossProtection_PauseMinutes | 60 | Trading pause duration (minutes) after max losses |
| LossProtection_ReduceLotSize | true | Reduce lot size after consecutive losses |
| LotReduction_Factor | 0.5 | Lot reduction factor (0.1-1.0, e.g., 0.5 = 50% reduction) |
| LotReduction_AfterLosses | 2 | Start reducing lot size after X consecutive losses |
| LotReduction_MinSize | 0.01 | Minimum lot size when reducing |
| LossProtection_IncreaseSL | false | Increase stop loss after consecutive losses |
| SL_Increase_Factor | 1.5 | SL increase factor (e.g., 1.5 = 50% larger SL) |
| SL_Increase_AfterLosses | 2 | Start increasing SL after X consecutive losses |
| SL_Increase_MaxMultiplier | 2.0 | Maximum SL multiplier |
| LossProtection_RestrictTrading | true | Restrict trading to higher probability setups |
| LossProtection_OnlyTrendSignals | false | Only take trend-following signals after losses |
| LossProtection_RequireConfirmation | true | Require signal confirmation after consecutive losses |
| LossProtection_ResetAfterWin | 1 | Reset consecutive loss count after X wins |
| LossProtection_ShowWarnings | true | Display consecutive loss warnings on chart |
| EnableSessionFilter | false | Enable trading session filtering |
| Session1_Enable | true | Enable Session 1 |
| Session1_StartHour | 8 | Session 1: Start Hour (0-23) |
| Session1_StartMinute | 0 | Session 1: Start Minute (0-59) |
| Session1_EndHour | 17 | Session 1: End Hour (0-23) |
| Session1_EndMinute | 0 | Session 1: End Minute (0-59) |
| Session2_Enable | false | Enable Session 2 |
| Session2_StartHour | 18 | Session 2: Start Hour (0-23) |
| Session2_StartMinute | 0 | Session 2: Start Minute (0-59) |
| Session2_EndHour | 23 | Session 2: End Hour (0-23) |
| Session2_EndMinute | 59 | Session 2: End Minute (0-59) |
| Session3_Enable | false | Enable Session 3 |
| Session3_StartHour | 0 | Session 3: Start Hour (0-23) |
| Session3_StartMinute | 0 | Session 3: Start Minute (0-59) |
| Session3_EndHour | 7 | Session 3: End Hour (0-23) |
| Session3_EndMinute | 59 | Session 3: End Minute (0-59) |
| EntryMethod | ENTRY_ALL_ENABLED | Entry signal requirement method |
| MinRequiredEntries | 2 | Minimum entries required (when using ENTRY_MIN_REQUIRED) |
| ConfirmationMethod | CONFIRM_ALL_ENABLED | Confirmation filter requirement method |
| MinRequiredConfirmations | 1 | Minimum confirmations required (when using CONFIRM_MIN_REQUIRED) |
| EvaluateOnNewBar | true | Only evaluate new entries on new bar (FASTER for backtesting) |
| VerboseLogging | false | Detailed print logs (DISABLE for faster backtesting) |
| DebugSignalDetails | false | Extra debug verbosity (DISABLE for faster backtesting) |
| EnableIchimoku1 | true | Enable Ichimoku 1 |
| Ichimoku1_TF | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Ichimoku 1 Timeframe |
| Ichimoku1_Tenkan | 9 | Ichimoku 1 Tenkan-sen |
| Ichimoku1_Kijun | 26 | Ichimoku 1 Kijun-sen |
| Ichimoku1_Senkou | 52 | Ichimoku 1 Senkou Span B |
| EnableIchimoku2 | true | Enable Ichimoku 2 |
| Ichimoku2_TF | 9 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Ichimoku 2 Timeframe |
| Ichimoku2_Tenkan | 9 | Ichimoku 2 Tenkan-sen |
| Ichimoku2_Kijun | 26 | Ichimoku 2 Kijun-sen |
| Ichimoku2_Senkou | 52 | Ichimoku 2 Senkou Span B |
| EnableIchimoku3 | true | Enable Ichimoku 3 |
| Ichimoku3_TF | 10 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Ichimoku 3 Timeframe |
| Ichimoku3_Tenkan | 9 | Ichimoku 3 Tenkan-sen |
| Ichimoku3_Kijun | 26 | Ichimoku 3 Kijun-sen |
| Ichimoku3_Senkou | 52 | Ichimoku 3 Senkou Span B |
| EnableMACD1 | true | Enable MACD 1 |
| MACD1_TF | 6 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // MACD 1 Timeframe |
| MACD1_FastEMA | 12 | MACD 1 Fast EMA |
| MACD1_SlowEMA | 26 | MACD 1 Slow EMA |
| MACD1_SignalSMA | 9 | MACD 1 Signal SMA |
| EnableMACD2 | true | Enable MACD 2 |
| MACD2_TF | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // MACD 2 Timeframe |
| MACD2_FastEMA | 12 | MACD 2 Fast EMA |
| MACD2_SlowEMA | 26 | MACD 2 Slow EMA |
| MACD2_SignalSMA | 9 | MACD 2 Signal SMA |
| EnableMACD3 | true | Enable MACD 3 |
| MACD3_TF | 9 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // MACD 3 Timeframe |
| MACD3_FastEMA | 12 | MACD 3 Fast EMA |
| MACD3_SlowEMA | 26 | MACD 3 Slow EMA |
| MACD3_SignalSMA | 9 | MACD 3 Signal SMA |
| EnableRSI1 | true | Enable RSI 1 |
| RSI1_TF | 6 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // RSI 1 Timeframe |
| RSI1_Period | 14 | RSI 1 Period |
| RSI1_Overbought | 70.0 | RSI 1 Overbought level |
| RSI1_Oversold | 30.0 | RSI 1 Oversold level |
| EnableRSI2 | true | Enable RSI 2 |
| RSI2_TF | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // RSI 2 Timeframe |
| RSI2_Period | 14 | RSI 2 Period |
| RSI2_Overbought | 70.0 | RSI 2 Overbought level |
| RSI2_Oversold | 30.0 | RSI 2 Oversold level |
| EnableRSI3 | true | Enable RSI 3 |
| RSI3_TF | 9 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // RSI 3 Timeframe |
| RSI3_Period | 14 | RSI 3 Period |
| RSI3_Overbought | 70.0 | RSI 3 Overbought level |
| RSI3_Oversold | 30.0 | RSI 3 Oversold level |
| ATR_TF | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // ATR Timeframe |
| ATR_Period | 14 | ATR Period |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX12070 Multi_Indicator_EA — Multi-indicator confluence (Ichimoku+MACD+RSI), full 12-layer stack."
#include <Trade\Trade.mqh>
#include <Indicators\Indicators.mqh>
CTrade trade;
// Custom enumerations
enum ENUM_LOT_SIZING_METHOD
{
LOT_FIXED, // Fixed lot size
LOT_PER_BALANCE, // Lot size based on balance
LOT_RISK_PERCENTAGE // Risk percentage based
};
enum ENUM_SL_RESOLVE
{
SL_SYSTEM_DECIDE, // System decides between ATR SL and Dynamic Lock
SL_USE_ATR, // Always use ATR SL
SL_USE_DYNAMIC_LOCK // Always use Dynamic Lock Profit
};
enum ENUM_ENTRY_METHOD
{
ENTRY_ALL_ENABLED, // All indicators must signal
ENTRY_MIN_REQUIRED, // Minimum required signals
ENTRY_ANY_SIGNAL // Any single signal triggers
};
enum ENUM_CONFIRMATION_METHOD
{
CONFIRM_ALL_ENABLED, // All confirmations required
CONFIRM_MIN_REQUIRED, // Minimum confirmations required
CONFIRM_ANY_CONFIRMATION // Any confirmation triggers
};
// ================= User Inputs ===============================
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_Ichimoku1_TF = PERIOD_H1;
ENUM_TIMEFRAMES g_Ichimoku2_TF = PERIOD_H1;
ENUM_TIMEFRAMES g_Ichimoku3_TF = PERIOD_H1;
ENUM_TIMEFRAMES g_MACD1_TF = PERIOD_H1;
ENUM_TIMEFRAMES g_MACD2_TF = PERIOD_H1;
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.