Pipsgrowth EX12067 MultiIndicatorConfluence
MT5 Expert Advisor (Open Source) · XAUUSD · M5
Pipsgrowth.com EX12067 gen2 — Volatility Gaussian Bands adaptive breakout EA, full 12-layer stack.
Overview
Pipsgrowth EX12067 keeps the volatility Gaussian-band core that defines the MultiIndicatorConfluence family but trims the entry stack down to the four conditions that actually matter in clean trend windows. The default profile arrives with Timeframe=0 (which the OnInit maps to PERIOD_H1, though the source header suggests M5-M15 for tighter pullbacks) and TrendFilterTF=6 mapped to PERIOD_H4, so the higher-timeframe EMA(50) gate is evaluated on H4 against the symbol's mid-term structure. The Gaussian midline itself is a 10-period EMA on the active timeframe, and the band envelope sits at DistanceMultiplier * ATR(14) = 0.85 * ATR by default — narrower than the 1.0 multiplier used elsewhere in the family, which gives the breakout a slightly tighter trigger. The band threshold is also auto-adapted when UseAutoFilter is left at its true default: the AutoTuneFilters function reads the live spread in points, picks a pip factor of 0.0001 below 3 points of spread and 0.01 above it, and then overrides the minimum ATR floor and break distance accordingly. That makes the EA more forgiving on quiet ECN feeds (lower minATR) and tighter on raw ECN or higher-spread gold feeds, without the trader having to re-tune the panel.
Entry logic is straightforward. On every tick, after CheckMaxDrawdown confirms the account drawdown is still inside MaxDrawdownPercent=10.0% and the Friday guard has not tripped, OnTick rebuilds the bands from the current Gaussian reading and the current ATR. A long signal requires the close of bar 0 to sit above the upper band while bars 1 and 2 closed below it (a 2-bar band confirmation, not a single-cross), the candle body to cover at least 60% of its full range (the strongCandle condition), the slope of the Gaussian midline to be rising (gaussNow > gaussPrev), the close to be above the H4 EMA(50), and the distance from price to the midline to exceed MinBreakDistance=0.3 * ATR. All six conditions have to fire together; nothing is OR'd. The short mirror is identical with the bands and EMA inverted. canTrade is gated by OneTradeOnly=true (default), MaxOpenTrades=5, AllowOnlyProfitableAdditions=true with MinProfitPerTradeToAdd=$5.0, and the Friday pre-close block. If everything lines up, CloseOpposite flattens any reverse-side exposure before trade.Buy or trade.Sell sends the order with the magic 22212067 and the comment 'Psgrowth.com Expert_12067'.
Risk on the open trade is fixed: Lots=0.1, slBuy = ask - ATR_MultiplierSL * atr (1.2 ATR below entry), slSell = ask + 1.2 ATR for shorts, with a hard fallback of HardSL_Points=120 if ATR returns zero on a thin session, and FixedTP_Points=160 for the reward arm. The reward-to-risk ratio is therefore roughly 160/144 at the default 1.2 ATR multiplier on XAUUSD where one ATR is close to 120 points — a 1.11:1 profile, deliberately conservative. There is no risk-percent, no martingale, no grid, and no per-trade compounding: the lot is a flat 0.1 the user has to change manually. UseTrailingStop=true and UseBreakeven=true are on by default, so the moment price moves 1.2 ATR in favor of the trade, OnTick's management block ratchets the stop to breakeven; from there, the ATR trailing moves it up another 1.2 ATR behind the bid on each new high (or 1.2 ATR beyond the ask on shorts), and never walks it backwards because the modify only fires when the new SL is strictly better than the existing one.
The dynamic lock-profit layer is the third management rung, gated by EnableDynamicLockProfit=true. It reads the floating P&L in account currency, divides by LockProfitEvery_X_Dollars=2.0 to get a step count, multiplies the step count back by 2.0 and subtracts LockMinusBuffer=1.0 to set the lock target, then converts that dollar target into a price offset using the symbol's tickValue and tickSize. So at $6 of profit, the step count is 3, the lock target is 5.0, and the SL is moved to entry+5.0/tickValue*tickSize on a long; at $20 of profit, the target is 19.0; at $50, it is 49.0. The buffer of 1.0 means the EA never locks the last $1, leaving a small give-back in case the broker re-quotes. The lock ratchet is also forward-only — it never lowers the stop once it has moved up — so a position that has banked $20 of profit keeps a 19-dollar floor even if it pulls back to $5.
The exit side adds an RSI early-exit using GetRSI(0) against the 14-period RSI on the active timeframe. When UseRSIEarlyExit=true (default), a long position is closed the moment RSI crosses above RSI_Overbought=70; a short is closed the moment RSI crosses below RSI_Oversold=30. The exit reads the live RSI on the same bar the entry decision is being evaluated, so on fast XAUUSD M5 the exit can fire within a few minutes of the overbought print. There is no divergence detection and no trend-confirmation filter on the exit, unlike the Gen2_RSA cousins in the family — the design choice here is to exit on the first overbought/oversold print rather than wait for confirmation across multiple bars. Combined with the 160-point fixed TP, this means the EA will frequently close before TP if momentum extends aggressively, and that is by design: the lock-profit ratchet is the fallback that guarantees the position never gives back more than LockMinusBuffer=1.0 once it has accumulated LockProfitEvery_X_Dollars of unrealized gain.
Friday management is the last safety valve. IsNearFridayClose returns true on Friday when hoursToClose = 17 - time.hour is less than or equal to 2 — so the window is 15:00-17:00 server time. When CloseTrades2HoursBeforeFriday is true (default), OnTick calls CloseAllPositions and returns before doing any signal work, so any open trade is flattened two hours before the typical 17:00 server close. When AvoidTrading2HoursBeforeFriday is also true (default), the canTrade gate refuses to send new orders in the same window, preventing the EA from opening a position that would immediately have to be closed. The two flags are independent: a trader who wants to hold through the close can disable the close flag while keeping the entry block, or vice versa.
Order execution is wrapped in three retry helpers. TryClose_EX12067 retries the close up to 3 times with a 200ms Sleep on TRADE_RETCODE_REQUOTE, TRADE_RETCODE_TIMEOUT, TRADE_RETCODE_PRICE_OFF, or TRADE_RETCODE_PRICE_CHANGED, then breaks on any other return code. TryClosePartial_EX12067 uses the same retry logic with PositionClosePartial. TryModify_EX12067 retries the modify up to 3 times with a 100ms Sleep on REQUOTE and TIMEOUT only. There is no OnDeinit cleanup, no OnTradeTransaction, no OnTester, and no dashboard or chart panel — the source has no Comment() calls and no Print() calls, so the EA runs silent. The trade object is a single global CTrade with SetExpertMagicNumber(22212067); filling mode is left to the broker's default via SetTypeFillingBySymbol.
The practical profile is a single-position, single-symbol, M5-or-H1 gold/GBP swing EA. The minimum recommended balance is $100 (the dashboard label in the family is $100+0.1 lot for the gold default), and the EA works on FX majors with the same panel by re-pointing the symbol — the source header explicitly marks the EA as portable. The drawdown cap is hard-coded at 10%, so worst-case loss is two or three correlated 120-point stops on a single position plus the lock-profit give-back. On FX majors, a 0.1 lot on EURUSD at 1.2 ATR with a 160-point TP is roughly $16 reward against $14 risk, with the trade running for an hour or two on M5. On XAUUSD, the same panel runs wider stops and bigger absolute reward.
A note on the family identity: this file is the 'gen2' label in the source header and uses magic 22212067. The Gen2_RSA label is reserved for cousins that hard-code RSI as a primary filter (EX12065, magic 22212065); EX12067 does not, so it should not be conflated with that variant. EX12067's identity is the SIMPLER 4-condition + auto-filter + single-position variant, sitting between the heavier Gen1 cousins and the Gen2_RSA full-stack sibling.
Strategy Deep Dive
On every tick, OnTick first checks the 10% drawdown cap and the Friday pre-close guard, then rebuilds the Gaussian midline (10-period EMA) and the 0.85 * ATR band envelope from the 4 indicator handles the EA created in OnInit. AutoTuneFilters adapts the minATR floor and break distance from the live spread when UseAutoFilter is true, so the EA tightens or loosens on quiet vs. wide ECN feeds without a manual re-tune. The long path requires six stacked conditions (2-bar band cross + strong candle + slope + HTF EMA alignment + break distance) to align inside a single tick, and then CloseOpposite flattens any reverse-side exposure before the new order fires. Management runs in three ratcheting layers: ATR trailing (1.2 * ATR, forward-only), breakeven (1.2 ATR in favor), and dynamic lock-profit (every $2 of gain, minus a $1 buffer), with the RSI overbought/oversold print and the Friday 15:00-17:00 server-time guard sitting on top as hard exits.
Long entry fires when close of bar 0 sits above the upper Gaussian band (midline + 0.85 * ATR by default) while bars 1 and 2 closed below it, the candle body covers at least 60% of its range, the Gaussian slope is rising, the H4 EMA(50) is below price, and price extends more than 0.3 * ATR above the midline. Short entry is the mirror image with the lower band and slope. OneTradeOnly=true holds the position count to 1 by default and MaxOpenTrades caps it at 5 with an optional $5 minimum profit per existing position to allow scaling.
Open positions are closed when the floating profit hits a 160-point fixed take-profit, when the ATR trailing stop is ratcheted to 1.2 ATR behind the bid (or 1.2 ATR beyond the ask for shorts), when the position's RSI crosses above 70 (longs) or below 30 (shorts) with UseRSIEarlyExit=true, or when the Friday 15:00-17:00 server-time guard calls CloseAllPositions two hours before market close. The dynamic lock-profit ratchet tightens the stop every $2 of unrealized gain, leaving a $1 buffer that prevents full give-back once the trade has accumulated a meaningful cushion.
Each position's stop-loss is anchored at 1.2 * ATR below entry for longs and 1.2 * ATR above entry for shorts, with a hard fallback of 120 points if ATR returns zero on a quiet session. The breakeven ratchet moves the stop to entry once price moves 1.2 ATR in favor, and the dynamic lock-profit ratchet tightens further every $2 of unrealized gain (minus a $1 buffer) without ever walking the stop backwards.
Fixed take-profit at 160 points from entry, with the ATR trailing stop normally hitting first when the Gaussian band trade runs to its band extreme. The dynamic lock-profit ratchet is the fallback that guarantees the position never gives back more than $1 once it has accumulated at least $2 of unrealized gain, so TP is functionally a soft cap rather than a hard ceiling.
Single-position, single-symbol gold or major-FX swing traders running the panel on XAUUSD M5 with $100 minimum equity and 0.1 lot fixed size. The default OneTradeOnly=true is the right bias for a clean H1 pullback profile; traders who want scaling should set OneTradeOnly=false and AcceptOnlyProfitableAdditions=true with MinProfitPerTradeToAdd=$5 to layer adds on a trend. The EA needs an ECN or low-spread broker with sub-point spreads for the AutoTuneFilters adaptation to work, and Friday 15:00-17:00 server-time guards need to be aligned with the broker's actual market-close hour — not all brokers close at 17:00 EST.
Strategy Logic
Pipsgrowth EX12067 MultiIndicatorConfluence — Strategy Logic Analysis (from .mq5 source)
Family: MultiIndicatorConfluence
Magic: 22212067
Version: 2.00
BRIEF:
Volatility Gaussian Bands EA using adaptive breakout for any pair and g_Timeframe with drawdown control, RSI early exit, dynamic lock profit and Friday close management. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
GetBuffer()GaussianFilter()GetATR()GetEMA_HTF()GetRSI()PositionExists()CloseOpposite()AutoTuneFilters()CheckMaxDrawdown()CountOpenTrades()AllPositionsHaveMinProfit()IsNearFridayClose()- ...and 4 more
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (16 total across 7 groups):
- [=== Signal ===] Timeframe = 0 //
Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) - [=== Signal ===]
TrendFilterTF= 6 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) - [=== Risk ===]
MaxDrawdownPercent=10.0// Max drawdown % allowed - [=== Trade Management ===]
MaxOpenTrades= 5 // Maximum allowed open trades at the same time - [=== Trade Management ===]
AllowOnlyProfitableAdditions=true// Enable filter - [=== Trade Management ===]
MinProfitPerTradeToAdd=5.0// Minimum $ profit required per existing trade - [=== Lock Profit ===]
LockProfitEvery_X_Dollars=2.0// Step: every $6 profit - [=== Lock Profit ===]
LockMinusBuffer=1.0// Lock profit minus $1 buffer - [===
RSI===] RSI_Period = 14 //RSIPeriod - [===
RSI===] RSI_Overbought = 70 //RSIOverboughtlevel - [===
RSI===] RSI_Oversold = 30 //RSIOversoldlevel - [===
RSI===]UseRSIEarlyExit=true// UseRSIfor early exit - [=== Friday Control ===]
CloseTrades2HoursBeforeFriday=true// Close all trades 2 hours before Friday close - [=== Friday Control ===]
AvoidTrading2HoursBeforeFriday=true// Don't open trades 2 hours before Friday close - [=== Identity ===]
InpMagicNumber=22212067// Magic Number - [=== Identity ===]
InpTradeComment= "Psgrowth.com Expert_12067" // TradeComment
// Pipsgrowth EX12067 MultiIndicatorConfluence — Execution Flow (from source analysis)
// Family: MultiIndicatorConfluence
// Volatility Gaussian Bands EA using adaptive breakout for any pair and g_Timeframe with drawdown control, RSI early exit, dynamic lock profit and Friday close management. 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 |
|---|---|---|
| Timeframe | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) |
| TrendFilterTF | 6 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) |
| MaxDrawdownPercent | 10.0 | Max drawdown % allowed |
| MaxOpenTrades | 5 | Maximum allowed open trades at the same time |
| AllowOnlyProfitableAdditions | true | Enable filter |
| MinProfitPerTradeToAdd | 5.0 | Minimum $ profit required per existing trade |
| LockProfitEvery_X_Dollars | 2.0 | Step: every $6 profit |
| LockMinusBuffer | 1.0 | Lock profit minus $1 buffer |
| RSI_Period | 14 | RSI Period |
| RSI_Overbought | 70 | RSI Overbought level |
| RSI_Oversold | 30 | RSI Oversold level |
| UseRSIEarlyExit | true | Use RSI for early exit |
| CloseTrades2HoursBeforeFriday | true | Close all trades 2 hours before Friday close |
| AvoidTrading2HoursBeforeFriday | true | Don't open trades 2 hours before Friday close |
| InpMagicNumber | 22212067 | Magic Number |
| InpTradeComment | "Psgrowth.com Expert_12067" | Trade Comment |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX12067 gen2 — Volatility Gaussian Bands adaptive breakout EA, full 12-layer stack."
#include <Trade\Trade.mqh>
CTrade trade;
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;
ENUM_TIMEFRAMES g_TrendFilterTF = PERIOD_H1;
input group "=== Signal ==="
input bool UseAutoFilter = true;
input int Length = 10;
input double DistanceMultiplier = 0.85;
input int Timeframe = 0; // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
input int TrendFilterTF = 6; // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
input int TrendEMA = 50;
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;
ENUM_TIMEFRAMES g_TrendFilterTF = PERIOD_H1;
input group "=== Risk ==="
input double Lots = 0.1;
input bool OneTradeOnly = true;
input double ATR_MultiplierSL = 1.2;
input double HardSL_Points = 120;
input double FixedTP_Points = 160;
input bool UseTrailingStop = true;
input bool UseBreakeven = true;
input double MinATR = 0.03;
input double MinBreakDistance = 0.3;
input double MaxDrawdownPercent = 10.0; // Max drawdown % allowed
ENUM_TIMEFRAMES MapTimeframeInt(int tf)Full source code available on download
Educational purposes only. Do NOT use with real money. Test on demo accounts only.
Clear Warning: Educational Purposes Only
Clear Warning: This Expert Advisor is for educational and testing purposes only. Do NOT use it with real money. Test only on demo accounts. Trading with real money involves substantial risk of capital loss. This does not constitute investment advice.
Recommended Brokers for This EA
These EAs run on MT5 — use a regulated broker with fast execution and tight spreads
Markets.com
Exness
IC Markets
Similar Expert Advisors
View All Expert AdvisorsMore Other strategy EAs from our library
Pipsgrowth EX01007 Adaptive
Pipsgrowth.com EX01007 Adaptive XAUUSD 5M — multi-indicator signal scorer with regime filter, full 12-layer stack, configurable timeframe, trailing/BE/profit-lock toggles, pyramid gate, spread filter, new-bar gate, filling mode detection.
Pipsgrowth EX01019 Adaptive
Pipsgrowth.com EX01019 Self-Adaptive Market EA Fixed — multi-regime adaptive EA, full 12-layer stack.
Pipsgrowth EX15029 SMC-OrderBlock
Pipsgrowth.com EX15029 SMCBreakoutEA — SMC breakout CHOCH/liquidity sweep EA, full 12-layer stack.
Community
Educational purposes only. Do NOT use with real money. Test on demo accounts only.