Pipsgrowth EX12010 MultiIndicatorConfluence
MT5 Expert Advisor (Open Source) · XAUUSD · M5
Pipsgrowth.com EX12010 A2_XAUUSD_5M — Volatility Gaussian Bands multi-filter confluence, full 12-layer stack.
Overview
Pipsgrowth EX12010 is a Gaussian-band breakout EA built around a 4-pole Ehlers smoothing kernel rather than a standard Bollinger-style deviation envelope. The author of the source code implemented GaussianFilterAdvanced() with the textbook two-pole cascade coefficients — alpha = 2.0/(1+length), a1 = exp(-sqrt(2)pi/length), b1 = 2a1*cos(sqrt(2)*pi/length), c1 = 1 - b1 + a1² — and seeds the recursion with the first three raw prices so the filter has no warm-up distortion on the chart. Length and slope thresholds are declared per timeframe: M1 length 6, M5 length 8, M15 length 10, H1 length 12; slope floors 0.00005, 0.00007, 0.0001, 0.00015 respectively. The band breakout uses DistanceMultiplier = 1.1 (with UseDifferentBandsForBuySell = false by default — the same envelope trades both sides unless the user opts into Length_Sell = 6 and DistanceMultiplier_Sell = 1.1 as a separate sell envelope). Trades are gated by seven stacked filters before any order is sent.
The first filter is the Gaussian slope itself: GetGaussianSlope() returns GaussianFilterAdvanced(0) − GaussianFilterAdvanced(1), so a buy requires the slope to exceed the per-TF positive threshold and a sell requires the slope to fall below the negative threshold. The second is the HTF trend EMA — by default TrendFilterTF = 6 maps to PERIOD_H4 and TrendEMA = 50, so a buy needs the bid above the H4 EMA-50 and a sell needs the ask below it. The third is the in-TF EMA(8) confirmation (ConfirmEMA = 8 by default) so the entry bar's bid/ask must be on the right side of the fast EMA. The fourth through seventh (RSI 14, ADX 14, Volume, MACD) are all disabled by default — EnableRSIFilter, EnableADXFilter, EnableVolumeFilter and EnableMACDConfirmation all default to off, so out of the box the EA only enforces the Gaussian slope, the HTF H4 EMA-50, and the EMA-8 confirm. A user who wants the 12-layer brief to actually run turns the four optional filters on via the per-filter ON/OFF enum.
Position sizing has a default of 0.1 lots with EnableAutoRisk = false. The MM_MODE selector then re-routes the lot through MM_FIXED_LOT, MM_BY_BALANCE, MM_BY_EQUITY, MM_BY_MARGIN_FREE or MM_BY_MARGIN_LEVEL — all five default to the fixed 0.10 lot unless MoneyManagementMode is changed. SL and TP are derived from a 14-period ATR in GetCurrentATR(). ATR_MultiplierSL = 1.5 sets the stop at 1.5× ATR away from the entry; TP1_Multiplier = 1.5 and TP2_Multiplier = 2.5 produce two profit targets at 1.5× and 2.5× ATR. With TradeSplitMode = TRADE_SPLIT_TP1_TP2 the EA fires two half-lot orders instead of one full-lot order — the first leg closes at TP1 and the runner closes at TP2. The alternative TRADE_FULL_SINGLE path puts the full lot at TP1 only. MinATR = 0.03 is a low-volatility trap gate: if ATR(14) is below 0.03 in price units, no orders go out even if the Gaussian slope and EMAs all align.
Trade management in ManageOpenPositions() runs five stops in cascade on every tick. The trailing stop — TrailLookbackCandles = 3 by default — does not use a fixed-point trail; instead it walks the last three completed candle lows (for longs) or highs (for shorts) and ratchets the stop to the tightest of those three swing levels whenever the new extreme is closer to price than the existing stop. Breakeven fires at BreakevenATRMultiplier = 1.5× ATR in profit, at which point TryModify_EX12010 slides the stop to the entry price with a small positive offset. TimeBasedExit closes anything older than MaxTradeDurationMinutes = 120 (default off). The two optional exit modes — ExitIfTrendWeakens (Gaussian slope reverses past the per-TF threshold) and ExitOnHeikenAshiReversal (HA bar flips color) — are off by default; enabling them turns the EA into a slope-aware trend follower that bails the moment the Ehlers filter rolls over.
Risk gates in RiskGuardCheck() are the per-day equity baseline plus hard caps: MaxDrawdownPercent = 10% intraday, MaxDailyLossPercent = 5% (though this input is not actually wired into the equity check — the EA measures drawdown against the day's starting equity, not realized P&L), and MinEquityProtection = 100 (any account below $100 stops opening new positions). CanTradeNow() resets the daily counter at DailyResetHour = 0 and rejects new entries once MaxTradesPerSymbolPerDay = 5 has been hit. There is no per-week cap, no global MaxTradesPerDay, and no min-equity-percent-of-balance gate — those layers in the brief are aspirational. The news filter pulls ForexFactory's weekly XML via WebRequest with a 5-second timeout, and blocks entries 15 minutes before and 15 minutes after any high-impact event for the chart symbol (FilterNewsBySymbol = true). It is a clean per-event window without a NFP-only special case.
Execution uses CTrade with SetDeviationInPoints(MaxSlippagePoints = 5) and SetExpertMagicNumber(22212010). Close and modify helpers TryClose_EX12010 and TryModify_EX12010 both retry up to three times: closes retry on REQUOTE / TIMEOUT / PRICE_OFF / PRICE_CHANGED with 200ms sleep between attempts; modifies retry on REQUOTE / TIMEOUT only with 100ms sleep, and do not retry on PRICE_CHANGED (so a fast market can leave the SL ratcheting in the dust). OnlyNewBarEntry and the per-trade-candle timestamp lastTradeCandleTime mean the EA evaluates the entry once per M5 bar, which keeps trade frequency modest for a gold EA. OppositeCloseMode = CLOSE_OPPOSITE_ON_SIGNAL is the default, so a fresh sell signal will close an open buy before opening the new sell. In practice the backtest for this EA on XAUUSD M5 should show a moderate trade count (a few per week at most), with most winners coming from the TP1 half and runners occasionally stretching to TP2.
Strategy Deep Dive
Each M5 bar tick walks the Gaussian filter, computes the slope as the difference between the current and previous filtered values, and compares it against a per-TF floor (0.00007 on M5 by default). When the slope passes the floor, the EA checks the H4 EMA-50 trend direction and the in-TF EMA-8 confirmation, then layers the optional RSI, ADX, volume, MACD and SuperTrend filters on top via the ConfirmAllFilters() dispatcher. If all enabled gates clear — including spread ≤ 30 points, ATR ≥ 0.03, no news event in the blackout window, and only one trade per bar — ExecuteBuyOrders or ExecuteSellOrders opens a market position sized by CalculateLotSize(). ManageOpenPositions() then runs the trailing-stop, break-even, and optional exit cascade on every subsequent tick until TP1, TP2, or a stop fires.
Entries are generated by Gaussian-band breakouts in the direction of a positive or negative Ehlers slope, gated by the H4 EMA-50 trend direction and the in-TF EMA-8 confirmation. By default only those three filters are active; the optional RSI, ADX, volume, MACD, SuperTrend and Heiken Ashi filters are off and only fire when the user enables them via their per-filter ON/OFF enum. A trade is evaluated once per M5 bar and only placed if the spread is below 30 points and no news event is within the 15-minute blackout window.
Exits run on a five-stop cascade managed in ManageOpenPositions() every tick. The trailing stop ratchets to the tightest of the last three swing lows (longs) or swing highs (shorts); break-even moves the stop to entry at 1.5× ATR in profit; the optional time exit closes trades older than 120 minutes; the optional Gaussian slope reversal exit fires when the Ehlers slope rolls over; and the optional Heiken Ashi reversal exit closes on a color flip of the HA bar. Opposite-signal entries also close any open position in the other direction via TryClose_EX12010.
Stop-loss is computed in ExecuteBuyOrders / ExecuteSellOrders as 1.5× ATR(14) on the entry bar, with the trailing-stop ratchet and the 1.5× ATR break-even in ManageOpenPositions() usually tightening it long before price reaches it. A global drawdown cap at 10% of the day's starting equity and a $100 equity floor halt all new entries if breached.
Two profit targets at 1.5× and 2.5× ATR are placed by default. TradeSplitMode = TRADE_SPLIT_TP1_TP2 splits the entry into two half-lot orders, one closing at TP1 and a runner closing at TP2; switching to TRADE_FULL_SINGLE concentrates the full lot on TP1 only. The trailing stop and break-even usually close trades before TP2 is hit on average.
Best for XAUUSD on M5 with a $100 minimum deposit on a low-spread ECN/Raw account (gold spread below 30 points is the hard gate), and most consistent when the M5 Gaussian slope has clear direction. The default RiskPercent = 1.0% with EnableAutoRisk = false (0.10 fixed lot) is calibrated for a $1,000–$5,000 micro account; raise the lot or flip EnableAutoRisk on for larger balances. Recommended for traders comfortable turning on optional filters one at a time and watching the ConfirmAllFilters() panel to learn which gate the EA is rejecting on in choppy markets.
Strategy Logic
Pipsgrowth EX12010 MultiIndicatorConfluence — Strategy Logic Analysis (from .mq5 source)
Family: MultiIndicatorConfluence
Magic: 22212010
Version: 2.00
BRIEF:
Volatility Gaussian Bands EA with multi-g_Timeframe Gaussian filter, slope detection and band-breakout entries. Confirmed by HTF trend EMA, Heiken Ashi, RSI, ADX, volume and SuperTrend filters. Supports split TPs, trailing, recovery mode and risk- based lot sizing. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
ShowInfoPanel()ShowFilterPanel()AddFilterStatus()CanTradeNow()ShouldOpenTrade()CheckTradeConditions()ManageOpenPositions()CalculateLotSize()TrackTrade()CanOpenTrade()CountOpenTradesByType()CountTradesOlderThan()- ...and 26 more
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (66 total across 8 groups):
- [=== 1.
GENERALTRADESETTINGS===]TradeMode=TRADE_BUY_AND_SELL// Whether to close existing opposite trades when a new signal appears. - [=== 1.
GENERALTRADESETTINGS===]OppositeCloseMode=CLOSE_OPPOSITE_ON_SIGNAL// Trading style: one position at a time, or allow multiple. - [=== 1.
GENERALTRADESETTINGS===]TradingStyle=SINGLE_POSITION// Whether to allow hedging mode (holding both buy and sell) - [=== 1.
GENERALTRADESETTINGS===]AllowHedgingMode=false// Order type: Market execution or Pending orders. - [=== 1.
GENERALTRADESETTINGS===]OrderExecMode=EXECUTE_MARKET_ORDERS// Signal behavior: normal or reversed. - [=== 1.
GENERALTRADESETTINGS===]SignalLogic=SIGNAL_NORMAL// Trade splitting: one TP or split into multiple take profits. - [=== 2.
STRATEGYCORESETTINGS===] Timeframe = 1 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Signal evaluation timeframe - [=== 2.
STRATEGYCORESETTINGS===]PriceSource= 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // Source price for calculations - [=== 2.
STRATEGYCORESETTINGS===]MaxSlippagePoints= 5 // Max allowed slippage in points - [===
GAUSSIANFILTERSETTINGSPERg_Timeframe===]EnableGaussianFilter=true// ---M1Settings ---// - [===
GAUSSIANFILTERSETTINGSPERg_Timeframe===] G_MinSlope_M1 =0.00005// ---M5Settings ---// - [===
GAUSSIANFILTERSETTINGSPERg_Timeframe===] G_MinSlope_M5 =0.00007// ---M15Settings ---// - [===
GAUSSIANFILTERSETTINGSPERg_Timeframe===] G_MinSlope_M15 =0.0001// ---H1Settings ---// - [===
GAUSSIANFILTERSETTINGSPERg_Timeframe===] G_MinSlope_H1 =0.00015// --- Slope FilterControl(uses Gaussian slope) ---// - [===
BANDBREAKOUTSETTINGS===]DistanceMultiplier=1.1// Band width multiplier (Buy) - [===
BANDBREAKOUTSETTINGS===]UseDifferentBandsForBuySell=false// Use separate Sell side settings - [===
BANDBREAKOUTSETTINGS===] Length_Sell = 6 // Sell Gaussian Length - [===
BANDBREAKOUTSETTINGS===]DistanceMultiplier_Sell=1.1// Band width multiplier (Sell) - [=== 3.
ENTRYFILTERS&CONFIRMATIONS===]TrendFilterTF= 6 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) - [=== 3.
ENTRYFILTERS&CONFIRMATIONS===]TrendEMA= 50 // ---EMAConfirmation Mode --- - [=== 3.
ENTRYFILTERS&CONFIRMATIONS===]ConfirmEMA= 8 // --- Heiken Ashi Mode --- - [=== 3.
ENTRYFILTERS&CONFIRMATIONS===]EnableHAEngulfingConfirmation=false// ---RSIFilter --- - [=== 3.
ENTRYFILTERS&CONFIRMATIONS===] RSISellLevel =45.0// ---ADXFilter --- - [=== 3.
ENTRYFILTERS&CONFIRMATIONS===]MinADXStrength=20.0// --- Volume Filter --- - [=== 3.
ENTRYFILTERS&CONFIRMATIONS===]VolumeLookback= 10 // Lookback bars to calculate average volume - [=== 3.
ENTRYFILTERS&CONFIRMATIONS===]VolumeSpikeMultiplier=1.5// Multiplier over average to consider as spike - [=== 3.
ENTRYFILTERS&CONFIRMATIONS===]RequireVolumeSpike=false// Require volume spike as extra condition - [=== 3.
ENTRYFILTERS&CONFIRMATIONS===] ST_SourcePrice = 5 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) - [=== 3.
ENTRYFILTERS&CONFIRMATIONS===]TrendScoreMinThreshold= 70 // --- Price Action & Entry Timing --- - [=== 4.
RISK&MONEYMANAGEMENT===] Lots =0.1// Fixed lot size if auto risk is disabled - [=== 4.
RISK&MONEYMANAGEMENT===]EnableAutoRisk=false// Enable dynamic lot size based on balance risk % - [=== 4.
RISK&MONEYMANAGEMENT===]RiskPercent=1.0// Risk % per trade whenAutoRiskis enabled - [=== 4.
RISK&MONEYMANAGEMENT===] MMReferencePercent =1.0// Percentage used in selected MM mode - [=== 4.
RISK&MONEYMANAGEMENT===] MMMinLot =0.01// Minimum lot allowed by broker - [=== 4.
RISK&MONEYMANAGEMENT===] MMMaxLot =100.0// Maximum lot allowed - [=== 4.
RISK&MONEYMANAGEMENT===] ATR_MultiplierSL =1.5// Multiplier for Stop Loss - [=== 4.
RISK&MONEYMANAGEMENT===] TP1_Multiplier =1.5// First TakeProfit(used ifTradeSplitModeactive) - [=== 4.
RISK&MONEYMANAGEMENT===] TP2_Multiplier =2.5// Second TakeProfit(used ifTradeSplitModeactive) - [=== 4.
RISK&MONEYMANAGEMENT===] SLDistancePoints = 150 // used ifEnableAutoRisk=true - [=== 4.
RISK&MONEYMANAGEMENT===]MinATR=0.03// Skip entries ifATRis too low (avoids low volatility traps) - [=== 4.
RISK&MONEYMANAGEMENT===]MinBreakDistance=0.3// Minimum required distance between price and band breakout - [=== 4.
RISK&MONEYMANAGEMENT===]MaxAllowedSpreadPoints=30.0// Max spread in points (e.g., 30 points =3.0pips) - [=== 4.
RISK&MONEYMANAGEMENT===]MaxDrawdownPercent=10.0// Stop all trading if drawdown exceeds this percentage - [=== 4.
RISK&MONEYMANAGEMENT===]MaxDailyLossPercent=5.0// Daily loss cutoff for trades - [=== 4.
RISK&MONEYMANAGEMENT===]MaxTradesOpenAtOnce= 2 // Limit the number of concurrent trades - [=== 4.
RISK&MONEYMANAGEMENT===]StopTradeAfterXLosses= 3 // Max consecutive losses allowed before pause - [=== 4.
RISK&MONEYMANAGEMENT===]MinEquityProtection=100.0// Stop trading if equity falls below this amount - [=== 4.
RISK&MONEYMANAGEMENT===]MaxTradesPerSymbolPerDay= 5 // Max number of trades per symbol per day - [=== 4.
RISK&MONEYMANAGEMENT===]DailyResetHour= 0 // Time to reset trade counters (0 = midnight server time) - [=== 4.
RISK&MONEYMANAGEMENT===]EnableLotIncreaseOnWin=false// Increase lot size after a win - [=== 4.
RISK&MONEYMANAGEMENT===]EnableLotReductionOnDrawdown=false// Reduce lot size if drawdown exceeds threshold - [=== 4.
RISK&MONEYMANAGEMENT===]LotStepFactorOnWin=1.2// Step multiplier if increasing lots on win - [=== 4.
RISK&MONEYMANAGEMENT===]LotDrawdownReduceThreshold=10.0// Drawdown % threshold before reducing lot - [=== 4.
RISK&MONEYMANAGEMENT===]EnableRecoveryMode=false// Activate smaller lot during recovery - [=== 4.
RISK&MONEYMANAGEMENT===]RecoveryLotSize=0.01// Lot size to use during recovery phase - [=== 4.
RISK&MONEYMANAGEMENT===]UseSeparateBuySellLimits=false// Independent trade limits for Buy/Sell - [=== 4.
RISK&MONEYMANAGEMENT===]MaxOpenBuyTrades= 1 // Max allowed Buy trades if separated - [=== 4.
RISK&MONEYMANAGEMENT===]MaxOpenSellTrades= 1 // Max allowed Sell trades if separated - [=== 4.
RISK&MONEYMANAGEMENT===]UseMinimumTradeAge=false// Require previous trades to reach age before re-entry - [=== 4.
RISK&MONEYMANAGEMENT===]MinTradeAgeMinutes= 10 // Age in minutes required before reentry is allowed - [=== 4.
RISK&MONEYMANAGEMENT===]UseMagicFilter=false// Filter based on MagicNumber(for multi-EAuse) - [=== 4.
RISK&MONEYMANAGEMENT===]EntryMagicNumber=22212010// Magic number assigned to new entries - [=== 4.
RISK&MONEYMANAGEMENT===]InpTradeComment= "Psgrowth.com Expert_12010" // TradeComment - [=== 4.
RISK&MONEYMANAGEMENT===]MaxTradesPerMagic= 1 // Maximum number of trades allowed per magic number - [=== 5.
EXITMANAGEMENT===]ExitSlopeSensitivity=0.0001// Minimum slope change to trigger exit - [===
FUTUREENHANCEMENTS===]AllowAutoOverrideInputsForTuning=false// +------------------------------------------------------------------+
// Pipsgrowth EX12010 MultiIndicatorConfluence — Execution Flow (from source analysis)
// Family: MultiIndicatorConfluence
// Volatility Gaussian Bands EA with multi-g_Timeframe Gaussian filter, slope detection and band-breakout entries. Confirmed by HTF trend EMA, Heiken Ashi, RSI, ADX, volume and SuperTrend filters. Supports split TPs, trailing, recovery mode and risk- based lot sizing. 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 |
|---|---|---|
| TradeMode | TRADE_BUY_AND_SELL | Whether to close existing opposite trades when a new signal appears. |
| OppositeCloseMode | CLOSE_OPPOSITE_ON_SIGNAL | Trading style: one position at a time, or allow multiple. |
| TradingStyle | SINGLE_POSITION | Whether to allow hedging mode (holding both buy and sell) |
| AllowHedgingMode | false | Order type: Market execution or Pending orders. |
| OrderExecMode | EXECUTE_MARKET_ORDERS | Signal behavior: normal or reversed. |
| SignalLogic | SIGNAL_NORMAL | Trade splitting: one TP or split into multiple take profits. |
| Timeframe | 1 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Signal evaluation timeframe |
| PriceSource | 1 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // Source price for calculations |
| MaxSlippagePoints | 5 | Max allowed slippage in points |
| EnableGaussianFilter | true | --- M1 Settings ---// |
| G_MinSlope_M1 | 0.00005 | --- M5 Settings ---// |
| G_MinSlope_M5 | 0.00007 | --- M15 Settings ---// |
| G_MinSlope_M15 | 0.0001 | --- H1 Settings ---// |
| G_MinSlope_H1 | 0.00015 | --- Slope Filter Control (uses Gaussian slope) ---// |
| DistanceMultiplier | 1.1 | Band width multiplier (Buy) |
| UseDifferentBandsForBuySell | false | Use separate Sell side settings |
| Length_Sell | 6 | Sell Gaussian Length |
| DistanceMultiplier_Sell | 1.1 | Band width multiplier (Sell) |
| TrendFilterTF | 6 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) |
| TrendEMA | 50 | --- EMA Confirmation Mode --- |
| ConfirmEMA | 8 | --- Heiken Ashi Mode --- |
| EnableHAEngulfingConfirmation | false | --- RSI Filter --- |
| RSISellLevel | 45.0 | --- ADX Filter --- |
| MinADXStrength | 20.0 | --- Volume Filter --- |
| VolumeLookback | 10 | Lookback bars to calculate average volume |
| VolumeSpikeMultiplier | 1.5 | Multiplier over average to consider as spike |
| RequireVolumeSpike | false | Require volume spike as extra condition |
| ST_SourcePrice | 5 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) |
| TrendScoreMinThreshold | 70 | --- Price Action & Entry Timing --- |
| Lots | 0.1 | Fixed lot size if auto risk is disabled |
| EnableAutoRisk | false | Enable dynamic lot size based on balance risk % |
| RiskPercent | 1.0 | Risk % per trade when AutoRisk is enabled |
| MMReferencePercent | 1.0 | Percentage used in selected MM mode |
| MMMinLot | 0.01 | Minimum lot allowed by broker |
| MMMaxLot | 100.0 | Maximum lot allowed |
| ATR_MultiplierSL | 1.5 | Multiplier for Stop Loss |
| TP1_Multiplier | 1.5 | First Take Profit (used if TradeSplitMode active) |
| TP2_Multiplier | 2.5 | Second Take Profit (used if TradeSplitMode active) |
| SLDistancePoints | 150 | used if EnableAutoRisk = true |
| MinATR | 0.03 | Skip entries if ATR is too low (avoids low volatility traps) |
| MinBreakDistance | 0.3 | Minimum required distance between price and band breakout |
| MaxAllowedSpreadPoints | 30.0 | Max spread in points (e.g., 30 points = 3.0 pips) |
| MaxDrawdownPercent | 10.0 | Stop all trading if drawdown exceeds this percentage |
| MaxDailyLossPercent | 5.0 | Daily loss cutoff for trades |
| MaxTradesOpenAtOnce | 2 | Limit the number of concurrent trades |
| StopTradeAfterXLosses | 3 | Max consecutive losses allowed before pause |
| MinEquityProtection | 100.0 | Stop trading if equity falls below this amount |
| MaxTradesPerSymbolPerDay | 5 | Max number of trades per symbol per day |
| DailyResetHour | 0 | Time to reset trade counters (0 = midnight server time) |
| EnableLotIncreaseOnWin | false | Increase lot size after a win |
| EnableLotReductionOnDrawdown | false | Reduce lot size if drawdown exceeds threshold |
| LotStepFactorOnWin | 1.2 | Step multiplier if increasing lots on win |
| LotDrawdownReduceThreshold | 10.0 | Drawdown % threshold before reducing lot |
| EnableRecoveryMode | false | Activate smaller lot during recovery |
| RecoveryLotSize | 0.01 | Lot size to use during recovery phase |
| UseSeparateBuySellLimits | false | Independent trade limits for Buy/Sell |
| MaxOpenBuyTrades | 1 | Max allowed Buy trades if separated |
| MaxOpenSellTrades | 1 | Max allowed Sell trades if separated |
| UseMinimumTradeAge | false | Require previous trades to reach age before re-entry |
| MinTradeAgeMinutes | 10 | Age in minutes required before reentry is allowed |
| UseMagicFilter | false | Filter based on Magic Number (for multi-EA use) |
| EntryMagicNumber | 22212010 | Magic number assigned to new entries |
| InpTradeComment | "Psgrowth.com Expert_12010" | Trade Comment |
| MaxTradesPerMagic | 1 | Maximum number of trades allowed per magic number |
| ExitSlopeSensitivity | 0.0001 | Minimum slope change to trigger exit |
| AllowAutoOverrideInputsForTuning | false | +------------------------------------------------------------------+ |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX12010 A2_XAUUSD_5M — Volatility Gaussian Bands multi-filter confluence, full 12-layer stack."
#include <Trade\Trade.mqh>
CTrade trade;
#define MathPI 3.14159265358979323846
datetime lastTradeCandleTime = 0;
string g_filterStatus[];
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_APPLIED_PRICE MapAppliedPriceInt(int ap)
{
switch(ap)
{
case 1: return PRICE_CLOSE;
case 2: return PRICE_OPEN;
case 3: return PRICE_HIGH;
case 4: return PRICE_LOW;
case 5: return PRICE_MEDIAN;
case 6: return PRICE_TYPICAL;
case 7: return PRICE_WEIGHTED;
default: return PRICE_CLOSE;
}
}
ENUM_TIMEFRAMES g_Timeframe = PERIOD_H1;
ENUM_TIMEFRAMES g_TrendFilterTF = PERIOD_H1;
ENUM_APPLIED_PRICE g_PriceSource = PRICE_CLOSE;
ENUM_APPLIED_PRICE g_ST_SourcePrice = PRICE_CLOSE;
input group "=== 1. GENERAL TRADE SETTINGS ==="
// Trade mode: choose Buy, Sell, or both. Prevents conflicts between EnableBuy/Sell.
// Benefit: safer logic, no contradictory settings.
enum ENUM_TRADE_MODE {
TRADE_BUY_ONLY, // Only Buy positions
TRADE_SELL_ONLY, // Only Sell positions
TRADE_BUY_AND_SELL // Allow both directions
};
input ENUM_TRADE_MODE TradeMode = TRADE_BUY_AND_SELL;
// Whether to close existing opposite trades when a new signal appears.
// Helps reduce conflicting positions.
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.