Pipsgrowth EX12026 MultiIndicatorConfluence
MT5 Expert Advisor (Open Source) · XAUUSD · M5
Pipsgrowth.com EX12026 EA_MCS_copy — Advanced Gaussian bands breakout with RSI and multi-session filters, full 12-layer stack.
Overview
EX12026 — Volatility Gaussian Bands Pro is a band-breakout Expert Advisor that fuses an EMA-derived Gaussian midline with a body-quality candle filter, a higher-timeframe trend gate, and an RSI confirmation step. The 107 inputs and 78 functions make it the most configurable member of the EX12 breakout family in this build, but the trading core is intentionally compact: a single 10-period EMA on the trading timeframe, two price bands at ±0.85×ATR around that midline, a 50-period EMA on a higher timeframe, and a 14-period RSI. Most of the input surface area is dedicated to filter tuning, position management, and multi-session trade windows rather than to additional indicators.
The entry logic lives in GenerateSignal(). On every accepted tick the EA loads the cached MarketData struct (bid, ask, OHLC, ATR, GaussianNow, GaussianPrev, EMA-HTF, an array of five recent RSI values, the symbol's pip size and digits), then computes two bands: upperBand = GaussianNow + 0.85 × ATR and lowerBand = GaussianNow − 0.85 × ATR. A long setup requires five concurrent conditions: price crossed above the upper band on this bar (current close above, both prior closes below — IsPriceBreakout()), the Gaussian slope is rising (GaussianNow > GaussianPrev), the close sits above the higher-timeframe EMA, the breakout extends at least MinBreakDistance × ATR (default 0.3×ATR) beyond the band, and the breakout bar is a strong candle — its body is at least 60% of its full range. Short setups are the mirror image. With the default UseRSIForEntries = true, an additional RSI filter demands that long signals form with RSI(0) < 70 and the slope still rising (RSI(1) < RSI(0)); short signals need RSI(0) > 30 with the slope falling. The Gaussian midline is intentionally simple — it is a plain iMA(... MODE_EMA ...) of length 10, not the 4-pole Ehlers filter used by EX12010, so the band edges are smooth but follow the EMA with normal lag.
What makes EX12026 distinctive inside the family is the AutoTuneFilters() block. When UseAutoFilter = true (default), the EA recomputes the effective MinATR, MinBreakDistance, and band multiplier at the start of every signal evaluation by sampling the current ATR against a 10-bar ATR average, the current spread against the recent average, the current hour, and the day of the week. The volatility ratio drives a high-vol or low-vol multiplier pair, the hour drives an Asian (0–7) / London (8–15) / New York (14–20) session adjustment, Monday gets a 0.9× day-of-week discount, Friday afternoon gets the same discount, and a wide spread (above 1.5× the recent average) tightens both filters by 5–10%. The result is a band whose required break distance is wider in quiet Asia-hours and tighter in active London hours — the EA does not change the indicator settings, only the acceptance thresholds.
The position-management stack is run from ManagePositionWithCache(), which is invoked on every tick through ManageOpenPositions(). Three cascades apply to the open trade in sequence: a 1.5×ATR trailing stop (ATR_MultiplierSL), a breakeven step that fires once the trade has moved in favour by at least 1.5×ATR, and a EnableDynamicLockProfit ladder that walks the stop upward (or downward for shorts) every 20 pips of new profit, leaving a 5-pip buffer behind. The dynamic lock is computed as stepCount × 20 − 5 pips of net locked profit. The hard safety nets are the HardSL_Points = 2000 (200-pip XAUUSD cap embedded into the SL formula via MathMax) and the EmergencyExitPips = 50 emergency exit that closes the trade if a losing position slips past 50 pips without the trailing stop catching up. The exit-only RSI early-exit path runs alongside, comparing the current RSI to a linearly-interpolated extreme level (default 80 for longs, 20 for shorts) and requiring 2 consecutive periods of confirmation (RSI_ExitConfirmationPeriods = 2); a divergent RSI price/RSI extreme also closes the position via CheckRSIDivergence() over an 8-bar lookback.
The risk layer pairs a MaxDrawdownPercent = 15 intraday drawdown gate with a CheckMaxDrawdown() equity-vs-balance check that halts all activity when the equity curve dips more than 15% below the balance. Lot sizing is RiskPerTrade = 1% of the balance computed against the ATR-based stop distance, with a Lots = 0.01 fallback for accounts where the percentage calc returns zero. Three trading windows are pre-wired: Session 1 from 01:00 to 05:00, Session 2 from 08:00 to 12:00, Session 3 from 16:00 to 20:00 (server time, all three enabled by default). The session check handles overnight wraps correctly — if a session's end minute is smaller than its start minute the EA treats it as crossing midnight. Friday carries a two-hour wind-down: with CloseTrades2HoursBeforeFriday = true, any open trade is force-closed at the 120-minute mark before FridayCloseHour = 22:00; with AvoidTrading2HoursBeforeFriday = true, no new entries are taken in that same window. The fixed-TP FixedTP_Points = 3000 (300 pips on XAUUSD) and the 30-point MaxSlippagePoints complete the order-side risk settings, with the spread filter MaxAllowedSpreadPips = 4.0 (calibrated for XAUUSD on IC Markets) skipping any tick whose spread is wider.
Holding constraints are unusually strict for a breakout EA. UseMinHoldTime = true blocks any close attempt during the first 3 minutes of a profitable position or 1 minute of a losing position, and BlockCloseOnSameCandle = true refuses to close a trade on the candle it opened in. MinSecondsBetweenTrades = 60 enforces at least 60 seconds between consecutive entries. Order execution is configurable through OrderExecutionType — market orders are the default, but the same signal path can emit BuyStop/SellStop 50 points away with a 12-hour expiration, or BuyLimit/SellLimit at the opposite side. Pending orders are maintained by ManagePendingOrders(), which expires them on time, on distance, on opposite signal, on wide spread, or modifies them tighter to market when the price closes within 2 pips of the trigger.
The retry layer is the standard three-attempt loop for closes and partial closes (200 ms sleep on REQUOTE, TIMEOUT, PRICE_OFF, PRICE_CHANGED) and a separate three-attempt loop for SL/TP modifies (100 ms sleep on REQUOTE/TIMEOUT only — PRICE_CHANGED is not retried on modifications, which is asymmetric versus the close path and reflects the reality that an SL change against a moving quote is not safe to retry blindly). All orders carry the magic 22212026 and the comment Psgrowth.com Expert_12026 for clean account separation when this EA is run alongside other EAs on the same terminal. An on-chart dashboard updated once per second shows balance, equity, open count, spread, last signal direction, and the timestamp of the most recent trade.
The 12-layer brief in the source header is aspirational — only the regime, signal, entry, confirm, no-trade, capital cap, risk, sizing, manage, exit, and scaling paths are wired in this build; a RunTests() framework and a TEST_OFF/TEST_SIGNAL/TEST_ORDER/TEST_SL_TP/TEST_POSITION_MGMT/TEST_INDICATORS enum are present for development but are off by default. One source quirk worth noting: the MapTimeframeInt helper is declared four times in the input section (identical bodies, no conflict because the compiler accepts the redeclarations and uses the last one), and the global g_Timeframe is initialised to PERIOD_H1 in each declaration but reset in OnInit from the Timeframe input — default value 0 maps to PERIOD_H1. The PipsGrowth listing for this EA targets XAUUSD M5, so for live deployment either change Timeframe to 2 (M5) or accept that the EA will run on H1 bars with the same signal logic. The behaviour is otherwise identical.
Expect backtests on XAUUSD M5 with default 1% risk to land in the same ballpark as a conservative trend-following system — win rate is modest, average winner is meaningfully larger than average loser thanks to the 1.5R-to-3R structure (1.5×ATR SL vs 300-point TP) and the dynamic lock-profit ladder, and max intraday drawdown on a single losing streak is bounded by the 15% equity gate. On demo, run it through at least one full London + New York cycle to confirm that the auto-tune behaviour matches your broker's spread and session timing before going live.
Strategy Deep Dive
Every accepted tick loads the cached MarketData struct (OHLC, ATR(14), Gaussian midline of 10-period EMA on the trading timeframe, higher-timeframe EMA(50), and a 5-element RSI(14) array) and runs the signal evaluation: a Gaussian-band crossover with a strong-candle body filter, an EMA-HT trend gate, and an RSI slope confirmation. The AutoTuneFilters() block re-scales the required MinATR and MinBreakDistance per tick against the volatility ratio, the active session, the day of the week, the spread, and the recent trend strength, so the band edges stay fixed while the acceptance thresholds breathe. Once a position is open, ManagePositionWithCache() chains a 1.5×ATR trailing stop, a 1.5×ATR breakeven step, and a 20-pip-step dynamic profit lock across every open trade; the RSI early-exit path and the 8-bar divergence check run in parallel, and the 50-pip emergency exit plus the Friday 22:00 wind-down provide hard safety nets. Order-side risk is bounded by a 15% intraday drawdown gate, a 4.0-pip spread cap, a 30-point slippage cap, and a 1%-of-balance risk-per-trade position size with a 0.01-lot fallback.
Long entry when the close crosses above the upper Gaussian band (Gaussian midline of 10-period EMA plus 0.85×ATR), the Gaussian slope is rising, the close is above the higher-timeframe EMA(50), the breakout extends at least 0.3×ATR beyond the band, and the breakout candle's body covers at least 60% of its range. RSI(14) must be below 70 with a rising slope. Short entry is the mirror image with RSI above 30 and a falling slope.
Exit on fixed take profit at 300 pips, on the dynamic lock-profit ladder stepping every 20 pips (5-pip buffer), on the 1.5×ATR trailing stop, on breakeven activation after 1.5×ATR of favourable movement, on the RSI early-exit signal confirmed over 2 consecutive periods against a linear-interpolated extreme level (80/20), on an 8-bar RSI divergence, or on the 50-pip emergency loss exit. All open trades are force-closed 2 hours before the Friday 22:00 broker close.
Initial stop loss is the larger of 1.5×ATR(14) and the 2000-point hard cap (200 pips on XAUUSD). The trailing stop then ratchets the SL to bid/ask ± 1.5×ATR, breakeven fires at 1.5×ATR of favourable movement, and the dynamic lock-profit ladder advances the SL by 20 pips of net profit for every additional 20 pips of price move.
Take profit is fixed at 3000 points (300 pips on XAUUSD) measured from the entry price. The dynamic lock-profit ladder also effectively caps losers and progressively locks in profit as price advances in 20-pip increments.
Recommended for XAUUSD on a 1% risk model with the default 1.5×ATR stop and 300-pip take profit; the 4.0-pip spread cap, the 0.3×ATR minimum breakout distance, and the 15% intraday drawdown gate are calibrated for gold's volatility profile, so a low-spread broker (ECN/RAW with sub-4-pip average gold spread) is required. The three default trading windows (01:00–05:00, 08:00–12:00, 16:00–20:00 server time) cover the Asian, London, and New York sessions; the Friday 22:00 wind-down assumes a 22:00 broker close and must be re-tuned for brokers with different Friday cutoffs. Minimum recommended balance is $100 (1% risk on a 1.5×ATR XAUUSD stop yields a 0.01–0.02 lot position, the fallback size), with $500–$1,000 preferred so the percentage-based lot calc operates without hitting the 0.01 floor.
Strategy Logic
Pipsgrowth EX12026 MultiIndicatorConfluence — Strategy Logic Analysis (from .mq5 source)
Family: MultiIndicatorConfluence
Magic: 22212026
Version: 2.00
BRIEF:
Advanced volatility Gaussian bands breakout EA with RSI divergence exit, dynamic profit locking, multi-session trading windows, spread/slippage filters, pending order support, and comprehensive risk management with drawdown control. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
CanOpenNewTrade()CloseAllPositions()ManageOpenPositions()AllPositionsHaveMinProfit()ManagePendingOrders()RunTests()GetPipSize()PipsToPrice()PriceToPips()NormalizePrice()CalculateLotSize()GetPositionProfitInPips()- ...and 41 more
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (107 total across 15 groups):
- [=== Signal ===]
UseAutoFilter=true// Auto-tune filters based on spread - [=== Signal ===] Length = 10 // Gaussian filter length
- [=== Signal ===]
DistanceMultiplier=0.85// Band distance multiplier - [=== Signal ===]
StrongCandleBodyRatio=0.6// Strong candle body/range ratio (0.0-1.0) - [=== Signal ===] Timeframe = 0 //
Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trading timeframe - [=== Signal ===]
TrendFilterTF= 6 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trend filter timeframe - [=== Signal ===]
TrendEMA= 50 // Higher timeframeEMAperiod - [=== Signal ===]
MinATR=0.03// MinimumATRto trade - [=== Signal ===]
MinBreakDistance=0.3// Minimum price/band break distance - [=== Signal ===] ATR_Period = 14 //
ATRPeriod for calculations - [=== Signal ===]
TrendStrengthLookback= 10 // Bars for Recent Trend Strength Calc - [=== Identity ===] Lots =
0.01// Fixed lot size (fallback if Risk=0) - [=== Identity ===]
RiskPerTrade=1.0// Risk % per trade (1% for $100 account) - [=== Identity ===]
MaxOpenTrades= 1 // Maximum allowed open trades (1 for safety) - [=== Identity ===]
OneTradeOnly=true// Only one trade at a time (Enabled) - [=== Identity ===]
MagicNumber=22212026// Unique identifier forEAtrades - [=== Identity ===]
InpTradeComment= "Psgrowth.com Expert_12026" // Trade comment - [=== Exit ===] ATR_MultiplierSL =
1.5//ATRmultiplier for StopLoss(Slightly wider for Gold) - [=== Exit ===]
HardSL_Points= 2000 // Hard SL distance in points (e.g., 200 pips forXAUUSD) - [=== Exit ===]
FixedTP_Points= 3000 // Fixed Take Profit in points (e.g., 300 pips forXAUUSD) - [=== Exit ===]
UseTrailingStop=true// Use trailing stop - [=== Exit ===]
UseBreakeven=true// Move SL to breakeven after profit - [=== Manage ===]
EnableDynamicLockProfit=true// Enable profit locking - [=== Manage ===]
LockProfitEvery_X_Pips=20.0// Lock profit every 20 pips (Adjusted for Gold) - [=== Manage ===]
LockProfitBufferPips=5.0// Buffer pips to subtract (Adjusted for Gold) - [=== Confirm ===] RSI_Period = 14 //
RSIPeriod - [=== Confirm ===] RSI_Overbought = 70 //
RSIOverboughtlevel - [=== Confirm ===] RSI_Oversold = 30 //
RSIOversoldlevel - [=== Confirm ===] RSI_ExtremeLevelBuy = 80 //
RSIextremelevelfor buys (exit) - [=== Confirm ===] RSI_ExtremeLevelSell = 20 //
RSIextremelevelfor sells (exit) - [=== Confirm ===]
UseRSIForEntries=true// UseRSIfor trade entries - [=== Confirm ===]
UseRSIEarlyExit=true// UseRSIfor early exit - [=== Confirm ===]
UseRSIDivergenceExit=false// UseRSIdivergence for exit - [=== Confirm ===] RSI_DivergenceLookback = 8 // Bars to look back for divergence
- [=== Confirm ===] RSI_ExitConfirmationPeriods = 2 // Periods to confirm
RSIexit - [=== Confirm ===]
UseRSITrendForExit=true// UseRSItrend for exit - [=== Confirm ===] RSI_ExitSensitivity =
1.5//RSIsensitivity multiplier - [=== Confirm ===] RSI_ExitSensitivityDivisor =
3.0// Divisor forRSIExit Sensitivity Calc - [=== Risk ===]
MaxDrawdownPercent=15.0// Max drawdown % allowed (15% for small account) - [=== Risk ===]
AllowOnlyProfitableAdditions=true// Only add trades when profitable (N/A ifOneTradeOnly=true) - [=== Risk ===]
MinProfitPerTradeToAdd=5.0// Min $ profit for additional trades (N/A ifOneTradeOnly=true) - [=== Risk ===]
EmergencyExitPips=50.0// Emergency exit if losing 50 pips (Adjusted for Gold) - [=== Session 1 ===]
EnableSession1=true// Enable Session 1 - [=== Session 1 ===]
Session1StartHour= 1 // Session 1 StartHour(0-23) - [=== Session 1 ===]
Session1StartMinute= 0 // Session 1 Start Minute - [=== Session 1 ===]
Session1EndHour= 5 // Session 1 End Hour - [=== Session 1 ===]
Session1EndMinute= 0 // Session 1 End Minute - [=== Session 2 ===]
EnableSession2=true// Enable Session 2 - [=== Session 2 ===]
Session2StartHour= 8 // Session 2 Start Hour - [=== Session 2 ===]
Session2StartMinute= 0 // Session 2 Start Minute - [=== Session 2 ===]
Session2EndHour= 12 // Session 2 End Hour - [=== Session 2 ===]
Session2EndMinute= 0 // Session 2 End Minute - [=== Session 3 ===]
EnableSession3=true// Enable Session 3 - [=== Session 3 ===]
Session3StartHour= 16 // Session 3 Start Hour - [=== Session 3 ===]
Session3StartMinute= 0 // Session 3 Start Minute - [=== Session 3 ===]
Session3EndHour= 20 // Session 3 End Hour - [=== Session 3 ===]
Session3EndMinute= 0 // Session 3 End Minute - [=== Friday Controls ===]
CloseTrades2HoursBeforeFriday=true// Close all trades before Friday close - [=== Friday Controls ===]
AvoidTrading2HoursBeforeFriday=true// No new trades before Friday close - [=== Friday Controls ===]
FridayCloseHour= 22 // Hour when broker closes onFriday(0-23) - [=== Friday Controls ===]
FridayCloseMinute= 0 // Minute when broker closes onFriday(0-59) - [=== Entry ===]
OrderExpirationType=ORDER_TIME_GTC// Order expiration type - [=== Entry ===]
OrderExecutionType=MARKET_ORDERS// Order execution type (Keep Market for now, rely on slippage) - [=== Entry ===]
PendingOrderPoints= 50 // Points away for pending orders (e.g., 5 pips) - [=== Entry ===]
PendingOrderExpirationSeconds= 43200 // Seconds until order expires - [=== Entry ===]
PendingOrderDistanceMultiplier=1.5// Multiplier for Pending Order Distance - [=== Entry ===]
PendingOrderExpirationMultiplier=1.5// Multiplier for Pending Order Expiration Pips - [=== Entry ===]
ExpireByPips=false// Expire if price moves X pips - [=== Entry ===]
ExpirationPips= 50 // Pips to trigger expiration - [=== Entry ===]
ExpireOnOppositeSignal=false// Expire on opposite signal - [=== Manage ===]
UseMinHoldTime=true// Enable Min Holding Time - [=== Manage ===]
MinHoldTimeProfitMinutes= 3 // Min minutes for profitable position - [=== Manage ===]
MinHoldTimeLossMinutes= 1 // Min minutes for losing position - [=== Manage ===]
BlockCloseOnSameCandle=true// No close on same candle as open - [=== Manage ===]
UseMinTimeBetweenTrades=true// Minimum time between trades - [=== Manage ===]
MinSecondsBetweenTrades= 60 // Seconds between consecutive trades (Increased for latency) - [=== Entry ===]
MaxSlippagePoints= 30 // Maximum slippage in points (e.g., 3 pips for 200ms latency) - [=== Entry ===]
UseSmartSlippage=true// Dynamic slippage adjustment - [===
NO-TRADE===]EnableSpreadFilter=true// Enable spread filter for new trades (Enabled) - [===
NO-TRADE===]MaxAllowedSpreadPips=4.0// Max allowed spread (pips) for new trades (4.0forXAUUSD/IC) - [===
NO-TRADE===]EnableSpreadFilterPending=true// Enable spread filter for pending orders (Enabled) - [===
NO-TRADE===]EnableSpreadFilterAdditions=false// Enable spread filter for additional trades (N/A ifOneTradeOnly=true) - [=== Debug ===]
EnableDebugMode=false// Enable detailed debug logging - [=== Debug ===]
EnableTestMode=false// Run in test mode - [=== Debug ===]
TestSignalType= 0 // Test signal (0=auto, 1=buy, 2=sell) - [Testing Framework]
TestMode=TEST_OFF// Testing mode - [Testing Framework]
TestModeSignal= 0 // Test signal (0=auto, 1=buy, 2=sell) - [Testing Framework]
LogDetailedOutput=false// Log detailed testing output - [Auto-Tuning Parameters]
AutoTune_BasePipFactorThreshold=3.0// Spread threshold forBasePipFactor - [Auto-Tuning Parameters]
AutoTune_BaseMinATRFactor=3.0// Factor for Base MinATR - [Auto-Tuning Parameters]
AutoTune_VolatilityThreshold=1.5// Volatility Ratio threshold - [Auto-Tuning Parameters]
AutoTune_HighVol_ATR_Factor=1.2//ATRfactor during high volatility - [Auto-Tuning Parameters]
AutoTune_HighVol_Break_Factor=1.1// Break factor during high volatility - [Auto-Tuning Parameters]
AutoTune_LowVol_ATR_Factor=0.8//ATRfactor during low volatility - [Auto-Tuning Parameters]
AutoTune_LowVol_Break_Factor=0.9// Break factor during low volatility - [Auto-Tuning Parameters]
AutoTune_Session_ATR_Factor=0.9//ATRfactor during specific sessions - [Auto-Tuning Parameters]
AutoTune_Session_Break_Factor=0.95// Break factor during specific sessions - [Auto-Tuning Parameters]
AutoTune_DayOfWeek_ATR_Factor=0.9//ATRfactor for specific days (e.g., Monday) - [Auto-Tuning Parameters]
AutoTune_DayOfWeek_Break_Factor=0.95// Break factor for specific days - [Auto-Tuning Parameters]
AutoTune_HighSpread_Mult=1.5// Multiplier for high spread detection - [Auto-Tuning Parameters]
AutoTune_HighSpread_ATR_Factor=1.1//ATRfactor during high spread - [Auto-Tuning Parameters]
AutoTune_HighSpread_Break_Factor=1.05// Break factor during high spread - [Auto-Tuning Parameters]
AutoTune_TrendStrengthThreshold=0.7// Threshold for strong trend detection - [Auto-Tuning Parameters]
AutoTune_Trend_ATR_Factor=1.1//ATRfactor during strong trend - [Auto-Tuning Parameters]
AutoTune_Trend_Break_Factor=1.05// Break factor during strong trend - [Auto-Tuning Parameters]
baseMinATR=basePipFactor*AutoTune_BaseMinATRFactor// Use input - [Auto-Tuning Parameters]
baseBandMult=DistanceMultiplier// Use existing input
// Pipsgrowth EX12026 MultiIndicatorConfluence — Execution Flow (from source analysis)
// Family: MultiIndicatorConfluence
// Advanced volatility Gaussian bands breakout EA with RSI divergence exit, dynamic profit locking, multi-session trading windows, spread/slippage filters, pending order support, and comprehensive risk management with drawdown control. 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 |
|---|---|---|
| UseAutoFilter | true | Auto-tune filters based on spread |
| Length | 10 | Gaussian filter length |
| DistanceMultiplier | 0.85 | Band distance multiplier |
| StrongCandleBodyRatio | 0.6 | Strong candle body/range ratio (0.0-1.0) |
| Timeframe | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trading timeframe |
| TrendFilterTF | 6 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trend filter timeframe |
| TrendEMA | 50 | Higher timeframe EMA period |
| MinATR | 0.03 | Minimum ATR to trade |
| MinBreakDistance | 0.3 | Minimum price/band break distance |
| ATR_Period | 14 | ATR Period for calculations |
| TrendStrengthLookback | 10 | Bars for Recent Trend Strength Calc |
| Lots | 0.01 | Fixed lot size (fallback if Risk=0) |
| RiskPerTrade | 1.0 | Risk % per trade (1% for $100 account) |
| MaxOpenTrades | 1 | Maximum allowed open trades (1 for safety) |
| OneTradeOnly | true | Only one trade at a time (Enabled) |
| MagicNumber | 22212026 | Unique identifier for EA trades |
| InpTradeComment | "Psgrowth.com Expert_12026" | Trade comment |
| ATR_MultiplierSL | 1.5 | ATR multiplier for Stop Loss (Slightly wider for Gold) |
| HardSL_Points | 2000 | Hard SL distance in points (e.g., 200 pips for XAUUSD) |
| FixedTP_Points | 3000 | Fixed Take Profit in points (e.g., 300 pips for XAUUSD) |
| UseTrailingStop | true | Use trailing stop |
| UseBreakeven | true | Move SL to breakeven after profit |
| EnableDynamicLockProfit | true | Enable profit locking |
| LockProfitEvery_X_Pips | 20.0 | Lock profit every 20 pips (Adjusted for Gold) |
| LockProfitBufferPips | 5.0 | Buffer pips to subtract (Adjusted for Gold) |
| RSI_Period | 14 | RSI Period |
| RSI_Overbought | 70 | RSI Overbought level |
| RSI_Oversold | 30 | RSI Oversold level |
| RSI_ExtremeLevelBuy | 80 | RSI extreme level for buys (exit) |
| RSI_ExtremeLevelSell | 20 | RSI extreme level for sells (exit) |
| UseRSIForEntries | true | Use RSI for trade entries |
| UseRSIEarlyExit | true | Use RSI for early exit |
| UseRSIDivergenceExit | false | Use RSI divergence for exit |
| RSI_DivergenceLookback | 8 | Bars to look back for divergence |
| RSI_ExitConfirmationPeriods | 2 | Periods to confirm RSI exit |
| UseRSITrendForExit | true | Use RSI trend for exit |
| RSI_ExitSensitivity | 1.5 | RSI sensitivity multiplier |
| RSI_ExitSensitivityDivisor | 3.0 | Divisor for RSI Exit Sensitivity Calc |
| MaxDrawdownPercent | 15.0 | Max drawdown % allowed (15% for small account) |
| AllowOnlyProfitableAdditions | true | Only add trades when profitable (N/A if OneTradeOnly=true) |
| MinProfitPerTradeToAdd | 5.0 | Min $ profit for additional trades (N/A if OneTradeOnly=true) |
| EmergencyExitPips | 50.0 | Emergency exit if losing 50 pips (Adjusted for Gold) |
| EnableSession1 | true | Enable Session 1 |
| Session1StartHour | 1 | Session 1 Start Hour (0-23) |
| Session1StartMinute | 0 | Session 1 Start Minute |
| Session1EndHour | 5 | Session 1 End Hour |
| Session1EndMinute | 0 | Session 1 End Minute |
| EnableSession2 | true | Enable Session 2 |
| Session2StartHour | 8 | Session 2 Start Hour |
| Session2StartMinute | 0 | Session 2 Start Minute |
| Session2EndHour | 12 | Session 2 End Hour |
| Session2EndMinute | 0 | Session 2 End Minute |
| EnableSession3 | true | Enable Session 3 |
| Session3StartHour | 16 | Session 3 Start Hour |
| Session3StartMinute | 0 | Session 3 Start Minute |
| Session3EndHour | 20 | Session 3 End Hour |
| Session3EndMinute | 0 | Session 3 End Minute |
| CloseTrades2HoursBeforeFriday | true | Close all trades before Friday close |
| AvoidTrading2HoursBeforeFriday | true | No new trades before Friday close |
| FridayCloseHour | 22 | Hour when broker closes on Friday (0-23) |
| FridayCloseMinute | 0 | Minute when broker closes on Friday (0-59) |
| OrderExpirationType | ORDER_TIME_GTC | Order expiration type |
| OrderExecutionType | MARKET_ORDERS | Order execution type (Keep Market for now, rely on slippage) |
| PendingOrderPoints | 50 | Points away for pending orders (e.g., 5 pips) |
| PendingOrderExpirationSeconds | 43200 | Seconds until order expires |
| PendingOrderDistanceMultiplier | 1.5 | Multiplier for Pending Order Distance |
| PendingOrderExpirationMultiplier | 1.5 | Multiplier for Pending Order Expiration Pips |
| ExpireByPips | false | Expire if price moves X pips |
| ExpirationPips | 50 | Pips to trigger expiration |
| ExpireOnOppositeSignal | false | Expire on opposite signal |
| UseMinHoldTime | true | Enable Min Holding Time |
| MinHoldTimeProfitMinutes | 3 | Min minutes for profitable position |
| MinHoldTimeLossMinutes | 1 | Min minutes for losing position |
| BlockCloseOnSameCandle | true | No close on same candle as open |
| UseMinTimeBetweenTrades | true | Minimum time between trades |
| MinSecondsBetweenTrades | 60 | Seconds between consecutive trades (Increased for latency) |
| MaxSlippagePoints | 30 | Maximum slippage in points (e.g., 3 pips for 200ms latency) |
| UseSmartSlippage | true | Dynamic slippage adjustment |
| EnableSpreadFilter | true | Enable spread filter for new trades (Enabled) |
| MaxAllowedSpreadPips | 4.0 | Max allowed spread (pips) for new trades (4.0 for XAUUSD/IC) |
| EnableSpreadFilterPending | true | Enable spread filter for pending orders (Enabled) |
| EnableSpreadFilterAdditions | false | Enable spread filter for additional trades (N/A if OneTradeOnly=true) |
| EnableDebugMode | false | Enable detailed debug logging |
| EnableTestMode | false | Run in test mode |
| TestSignalType | 0 | Test signal (0=auto, 1=buy, 2=sell) |
| TestMode | TEST_OFF | Testing mode |
| TestModeSignal | 0 | Test signal (0=auto, 1=buy, 2=sell) |
| LogDetailedOutput | false | Log detailed testing output |
| AutoTune_BasePipFactorThreshold | 3.0 | Spread threshold for BasePipFactor |
| AutoTune_BaseMinATRFactor | 3.0 | Factor for Base Min ATR |
| AutoTune_VolatilityThreshold | 1.5 | Volatility Ratio threshold |
| AutoTune_HighVol_ATR_Factor | 1.2 | ATR factor during high volatility |
| AutoTune_HighVol_Break_Factor | 1.1 | Break factor during high volatility |
| AutoTune_LowVol_ATR_Factor | 0.8 | ATR factor during low volatility |
| AutoTune_LowVol_Break_Factor | 0.9 | Break factor during low volatility |
| AutoTune_Session_ATR_Factor | 0.9 | ATR factor during specific sessions |
| AutoTune_Session_Break_Factor | 0.95 | Break factor during specific sessions |
| AutoTune_DayOfWeek_ATR_Factor | 0.9 | ATR factor for specific days (e.g., Monday) |
| AutoTune_DayOfWeek_Break_Factor | 0.95 | Break factor for specific days |
| AutoTune_HighSpread_Mult | 1.5 | Multiplier for high spread detection |
| AutoTune_HighSpread_ATR_Factor | 1.1 | ATR factor during high spread |
| AutoTune_HighSpread_Break_Factor | 1.05 | Break factor during high spread |
| AutoTune_TrendStrengthThreshold | 0.7 | Threshold for strong trend detection |
| AutoTune_Trend_ATR_Factor | 1.1 | ATR factor during strong trend |
| AutoTune_Trend_Break_Factor | 1.05 | Break factor during strong trend |
| baseMinATR | basePipFactor * AutoTune_BaseMinATRFactor | Use input |
| baseBandMult | DistanceMultiplier | Use existing input |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX12026 EA_MCS_copy — Advanced Gaussian bands breakout with RSI and multi-session filters, full 12-layer stack."
#define EA_NAME "Volatility Gaussian Bands Pro"
#define EA_VERSION "2.2.0"
#include <Trade/Trade.mqh> // Changed backslash to forward slash
CTrade trade;
// Place this at the top of the file with other global definitions
enum ENUM_SIGNAL_TYPE {
SIGNAL_NONE,
SIGNAL_BUY,
SIGNAL_SELL
};
// Keep this enum definition at the top
enum ENUM_TEST_MODE {
TEST_OFF, // No testing
TEST_SIGNAL, // Test signal generation
TEST_ORDER, // Test order execution
TEST_SL_TP, // Test SL/TP calculation
TEST_POSITION_MGMT, // Test position management
TEST_INDICATORS // Test indicator values
};
// Function prototypes
bool CanOpenNewTrade();
void CloseAllPositions();
void ManageOpenPositions();
bool AllPositionsHaveMinProfit(string symbol, double minProfit);
void ManagePendingOrders();
void RunTests();
double GetPipSize(string symbol = NULL);
double PipsToPrice(double pips, string symbol = NULL);
double PriceToPips(double price, string symbol = NULL);
double NormalizePrice(double price, string symbol = NULL);
double CalculateLotSize(double riskPercent, double slDistance);
double GetPositionProfitInPips(long type, double entryPrice, double currentBid, double currentAsk);
int GetPositionOpenBarByTicket(ulong ticket);
double CalculateTakeProfit(ENUM_POSITION_TYPE type, double entryPrice);
string ErrorDescription(int error_code);
ENUM_SIGNAL_TYPE GenerateSignal(bool applyRSIFilter = true);
bool ExecuteOrder(ENUM_SIGNAL_TYPE signalType, bool closeOpposite = true);
bool CheckRSIDivergence(ulong ticket);
void TestIndicators();
double CalculateRecentTrendStrength();
void AutoTuneFilters(double &minATR, double &breakDistance, double &bandMult);
bool CheckMaxDrawdown();
bool ConfirmRSIExit(ulong ticket);
int CountOpenTrades(string symbol, int maxCount = 0);
void UpdateDashboard();
//+------------------------------------------------------------------+
//| Feature toggle structure |
//+------------------------------------------------------------------+
struct FeatureToggles {
// Core features
bool UseTrailingStop;
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.