Pipsgrowth EX12047 MultiIndicatorConfluence
MT5 Expert Advisor (Open Source) · XAUUSD · M5, H1
Pipsgrowth.com EX12047 ex14_1_1 — MA-cross EA with DLP, pause guards and multi-filter confirmations, full 12-layer stack.
Overview
Pipsgrowth EX12047 turns a basic fast/slow moving-average crossover into a fully gated, multi-filter trend system with a step-locked trailing stop and per-trade tagging. The source file is Pipsgrowth_com_EX12047.mq5 (file-tag ex14_1_1), property version 2.00, magic 22212047, and the source header places it in the MultiIndicatorConfluence family.
The signal itself is a single-bar MA cross. On every new bar the EA asks Signal() to read the fast MA (default period 20) and the slow MA (default period 50) at bars 0 and 1 and watch for fast1 <= slow1 AND fast0 > slow0 (a buy cross) or its mirror (a sell cross). MA method defaults to MODE_SMA on PRICE_CLOSE. The moment a cross is detected, the EA produces a directional intent and immediately runs the slope direction filter that the header calls UseTrendSlopeFilter (default true) - the slow MA must slope in the trade's direction, meaning slow0 - slow1 must be positive for buys and negative for sells, otherwise the cross is dropped before it reaches the confirmation stage.
Below that first pass, eleven other filters are wired in but disabled by default. The full list of 12 layers the EA labels in its header is: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, and OnTester. The actual code never calls an OnTester() function - that 'layer' exists in the brief but is empty in the .mq5, the same artifact several siblings in this family show. The CAPITAL CAP, MANAGE, EXIT, and SCALING layers are the four that produce the EA's distinctive behaviour and are worth walking through.
The MANAGE layer is the Dynamic Lock Profit step-ratchet. ApplyDynamicLockProfitToPosition() runs on every tick against every owned position. It measures movedPts = (bid - open) for buys or (open - ask) for sells, divides by InpLockProfitEveryXPoints (default 150 points), and floors the result. The number of completed steps defines the lock distance: targetLockPts = steps * 150 - InpLockMinusYPointsBuffer (default 20). The new stop is then open + targetLockPts (for buys) or open - targetLockPts (for sells), and ModifyPositionSLTP() is called only if the new stop is tighter than the current one. The ratchet never loosens: a position at +310 points of profit has completed two full steps and is locked at +130 points (2 * 150 - 20 = 280). When the price pulls back the stop stays put. This is the EA's main trade-management expression, and unlike EX12045-46 it ships ON by default in EX12047.
The SCALING layer is the Initial vs Additional tagging. The EA keeps separate add-counters per direction: g_addBuyNext and g_addSellNext, both initialized to 1. When a buy signal fires and no buys are open, the trade is tagged 'Initial' and the counter is reset. When buys are already open the trade is tagged 'Add#1', 'Add#2', etc., with the comment string embedding the tag. MaxOpenTrades is fixed at 5 by default. Whether a non-initial entry is even allowed is gated by AllowOnlyProfitableAdditions (default true) - every same-direction open position must have moved at least MinProfitPerTradeToAdd points (default 5) in favour of the trade, computed by IsAllSameDirProfitableAtLeast() against current bid/ask.
The CAPITAL CAP layer is the loss-driven pause guard. OnTradeTransaction() watches every deal-exit. If the closed deal's PnL (profit + swap + commission) is negative, g_lossStreakCount increments and the absolute loss is added to g_lossStreakAmt. If PauseOnConsecutiveLosses is true (default false) and the streak reaches PauseConsecutiveLossesCount (default 3), the EA pushes g_tradePauseUntil forward by PauseConsecutiveLossesMinutes (default 60) and refuses to take new entries until that time passes. The same machinery works for PauseOnLossAmount (default off, threshold 100, 60-min pause) and both can be enabled together. A winning exit resets both counters.
The RISK and SIZING layers govern position size and SL/TP. By default, lot size is FixedLot = 0.10; switching UseRiskPercent to true makes LotsForRisk() compute a target lot from RiskPercent of balance (default 1%) divided by the per-lot risk in money for the chosen stop distance. SL and TP are 300 / 600 points fixed by default; UseATRforSLTP=false by default, but flipping it on switches both to ATR-derived distances: useSLpts = ATR_SL_Mult * ATR / point (default 3.0x) and useTPpts = ATR_TP_Mult * ATR / point (default 6.0x), each clamped to one tick above the broker's SYMBOL_TRADE_STOPS_LEVEL. The TP/SL ratio is 2:1 in both fixed and ATR modes.
The NO-TRADE layer bundles three short-circuit gates at the top of ConfirmationsPass(): the trade pause window, the post-trade cooldown (default off; CooldownMinutes default 5 if enabled), the spread cap, the session filter, and the directional toggles (AllowBuyTrades / AllowSellTrades). The session filter defaults to 7:00-22:00 server time and Session2 is off; flipping EnableSessionFilter off opens all hours. The spread cap defaults to SPREAD_MEDIAN_MULT: the EA keeps a 211-tick ring buffer of observed spreads, computes a rolling median, and rejects the trade if current spread exceeds 3.0x that median; the SPREAD_FIXED fallback cap is 35 points.
The remaining filters, all off by default, plug into the same confirmation chain. The bar quality filter (default body/range 0.45, max upper wick 0.40, min body 5pt) reads the previous bar's OHLC and rejects weak candles. The RSI filter (default 14-period) uses a directional band: buys need RSI between 55 and 90, sells between 20 and 45, with an optional slope test (MinRSISlope default 0.5). The ADX filter (default 14-period, ADX_Min 20) blocks trades in non-trending markets. The MA-separation filter requires the fast/slow gap to be at least MinMASeparationPoints (default 10pt) on the cross bar. The slow-MA slope magnitude filter rejects flat crosses. The HTF trend filter aligns the trade with a higher-timeframe slow MA slope (HTFPeriod = H1 by default, mappable M15-D1). The ATR volatility band rejects trades when ATR is below MinATRPoints (20pt default) or above MaxATRPoints (0 = disabled). The range-compression filter blocks trades when the high-low range over the last RangeLookbackBars (default 20) is below MinRangePoints (default 80pt).
Order routing uses SendOrderMarket() with a 3-mode fill sequence. The first attempt carries SL and TP; on rejection the same lot is retried without SL/TP and a separate SLTP modify is sent. If the first filling mode (selected from SYMBOL_FILLING_MODE, default FOK) is rejected, the EA walks the fallback sequence (FOK, IOC, RETURN) and the CTrade helpers TryClose_EX12047 / TryClosePartial_EX12047 / TryModify_EX12047 provide 3-retry execution on REQUOTE / TIMEOUT / PRICE_OFF / PRICE_CHANGED with 200ms (close) or 100ms (modify) sleeps.
What to expect in backtest: with all filters off, the EA is a textbook 20/50 SMA crossover on M5. Turning on UseTrendSlopeFilter alone reduces whipsaw noticeably. Activating the median-multiplier spread cap (the default) tightens entry quality on noisy symbols. The DLP ratchet, when it engages, often converts break-even trades into small wins because the locked stop fires before the full retracement. On trending pairs, the Initial/Add scaling with the profitability gate tends to load up on continuation moves; on choppy pairs the same gate keeps the trade count down.
Default deployment: XAUUSD M5 with $100 balance, 0.10 lots, 300/600-point fixed SL/TP, DLP ON at 150/-20 step/buffer, median-multiplier spread cap, 7:00-22:00 server-time session, 5-trade total cap. The expected typical spread is the broker's median over 211 ticks x 3 - for a 25-point gold spread that's 75 points, so wide-spread brokers should raise the multiplier's cap or set SpreadCapMode to SPREAD_FIXED.
Strategy Deep Dive
Each new bar, the Signal() function reads the 20- and 50-period SMAs at bars 0 and 1, flags a directional intent on a single-bar crossover, and runs the slow-MA slope direction filter (default ON). ConfirmationsPass() then gates the trade on seven independent checks: pause-window from the loss-streak/loss-amount guards, post-trade cooldown, median-multiplier spread cap, 7:00-22:00 server-time session, and the optional opt-in stack of bar quality, RSI directional band, ADX, MA separation, slow-MA slope magnitude, HTF trend alignment, ATR volatility band, and range compression. If the gate passes and there are no same-direction positions, the trade is tagged Initial; otherwise it is tagged Add#N, but only if all same-direction positions are at least 5 points in profit. Position size is fixed 0.10 lots or 1%-of-balance if UseRiskPercent=true, SL/TP are 300/600 points fixed or 3.0x/6.0x ATR if UseATRforSLTP=true. ApplyDynamicLockProfitToPosition() runs on every tick and ratchets the stop tighter by 130 points for each completed 150-point profit step, never loosens. Order routing uses a 3-mode fill fallback (FOK/IOC/RETURN) and the CTrade retry helpers handle REQUOTE/TIMEOUT/PRICE_OFF/PRICE_CHANGED with 200ms/100ms backoff.
Buy when the 20-period SMA crosses above the 50-period SMA (fast1 <= slow1 AND fast0 > slow0) and the slow MA slopes positive, then passes the confirmation chain: spread cap, session window, pause/cooldown gates, optional RSI/ADX/HTF/ATR/range/bar-quality filters, plus the MaxOpenTrades=5 and per-direction profitability gates for adds. Mirror logic for sells.
Exits come from the initial fixed SL/TP (300/600 points default, 1:2 RR) or from the DLP step-ratchet - each completed 150-point step locks the stop tighter by 150-20=130 points, never loosens, so a stop that moved 280 points into profit cannot retreat. There is no signal-based close; positions close only via SL or TP hit.
Fixed 300-point initial SL by default; flipping UseATRforSLTP=true switches to 3.0x ATR(14) distance clamped to one tick above the broker stop-level. The DLP step-ratchet tightens the SL after every 150-point profit increment, subtracting a 20-point buffer, and only ever moves closer to price - never loosens.
Fixed 600-point TP by default (1:2 RR with the 300-point SL); UseATRforSLTP=true switches TP to 6.0x ATR(14), preserving the same 2:1 RR against the ATR-derived SL. The TP is not modified by the DLP ratchet - only the SL is ratcheted tighter.
XAUUSD M5 or H1 on a $100 account with 0.10-lot fixed sizing. The default DLP ratchet + 7:00-22:00 server-time session + median-multiplier spread cap favour ECN/RAW-spread gold brokers with sub-30-point typical spreads and reliable tick data; FX majors work on M5 with the same setup but expect more whipsaw unless UseTrendSlopeFilter, ADX, and HTF alignment are all switched on. With minDeposit=$100 and riskLevel=MEDIUM, this is positioned for a small account testing the full EX12 filter stack; raise the deposit to $500-$1000 before turning on the pause guards and the per-trade Add#N scaling, since the loss-streak breaker is sized in account-relative points.
Strategy Logic
Pipsgrowth EX12047 MultiIndicatorConfluence — Strategy Logic Analysis (from .mq5 source)
Family: MultiIndicatorConfluence
Magic: 22212047
Version: 2.00
BRIEF:
Robust MA-cross EA with Dynamic Lock Profit step-ratchet, initial vs additional trade tagging, pause guards on consecutive losses, ECN-safe order wrappers, and multi-filter confirmations (RSI, ADX, MA separation, slope, HTF trend, ATR, range, bar quality, cooldown). 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
Log()LogI()LogD()LogW()NormalizeVolume()PipValuePerLotForDistance()LotsForRisk()TimeInSessions()SpreadBufferInitIfNeeded()SpreadBufferAdd()MedianSpread()CurrentSpreadPoints()- ...and 19 more
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (75 total across 19 groups):
- [=== Core Identification ===]
MagicNumber=22212047// Expert MagicNumber(55000,1,56000) - [=== Core Identification ===]
InpTradeComment= "Psgrowth.com Expert_12047" // OrderCommentPrefix("EA","","EA") - [=== Direction Permissions ===]
AllowBuyTrades=true// EnableBUYTrades(false/true) - [=== Direction Permissions ===]
AllowSellTrades=true// EnableSELLTrades(false/true) - [=== Signal & Indicator Filters ===]
FastMAPeriod= 20 // Fast MAPeriod(5,1,100) - [=== Signal & Indicator Filters ===]
SlowMAPeriod= 50 // Slow MAPeriod(10,1,200) - [=== Signal & Indicator Filters ===]
MaMethod=MODE_SMA// MAMethod(not optimized) - [=== Signal & Indicator Filters ===]
MaPrice= 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MA AppliedPrice(not optimized) - [=== Signal & Indicator Filters ===]
SignalOncePerBar=true// One Signal PerBar(false/true) - [===
RSIFilter ===]UseRSIFilter=false// EnableRSIFilter(false/true) - [===
RSIFilter ===] RSIPeriod = 14 //RSIPeriod(5,1,30) - [===
RSIFilter ===] RSI_BuyMin = 55 //BUY: MinRSI(40,1,70) - [===
RSIFilter ===] RSI_BuyOverbought = 90 //BUY: Overbought cap (70,1,99) - [===
RSIFilter ===] RSI_SellMax = 45 //SELL: MaxRSI(30,1,60) - [===
RSIFilter ===] RSI_SellOversold = 20 //SELL: Oversold floor (1,1,30) - [===
ADX& Trend Filters ===]UseADXFilter=false// EnableADXStrengthFilter(false/true) - [===
ADX& Trend Filters ===] ADXPeriod = 14 //ADXPeriod(5,1,30) - [===
ADX& Trend Filters ===] ADX_Min = 20 // MinimumADXTrendStrength(10,5,40) - [===
ADX& Trend Filters ===]UseTrendSlopeFilter=true// Require Slow MA Slope inDirection(false/true) - [=== MA Separation Filter ===]
UseMASeparationFilter=false// Require Min Fast/Slow MASeparation(false/true) - [=== MA Separation Filter ===]
MinMASeparationPoints=10.0// Min MASeparation(pts) (5.0,1.0,100.0) - [=== Slow MA Slope Magnitude Filter ===]
UseSlopeMagnitudeFilter=false// Require Min Slow MA SlopeMagnitude(false/true) - [=== Slow MA Slope Magnitude Filter ===]
MinSlowMASlopePoints=1.5// Min Slow MASlope(pts) (0.5,0.1,10.0) - [=== Higher Timeframe Trend Filter ===]
UseHTFTrendFilter=false// Align With Higher TF Slow MASlope(false/true) - [=== Higher Timeframe Trend Filter ===] HTFPeriod = 8 //
Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Higher TF For TrendAlignment(PERIOD_M15..PERIOD_D1) - [===
ATRVolatility Filter ===]UseATRVolatilityFilter=false//ATRVolatility BandFilter(false/true) - [===
ATRVolatility Filter ===]MinATRPoints=20.0// MinATR(pts) (0 disables) (0,0,200) - [===
ATRVolatility Filter ===]MaxATRPoints=0.0// MaxATR(pts) (0 disables) (0,0,400) - [=== Range Compression Filter ===]
UseRangeCompressionFilter=false// Block If Recent Range TooSmall(false/true) - [=== Range Compression Filter ===]
RangeLookbackBars= 20 // Range LookbackBars(10,5,200) - [=== Range Compression Filter ===]
MinRangePoints=80.0// Min High-LowRange(pts) (30.0,10.0,500.0) - [=== Post-Trade Cooldown ===]
UsePostTradeCooldown=false// Cooldown After Any NewTrade(false/true) - [=== Post-Trade Cooldown ===]
CooldownMinutes= 5 // CooldownMinutes(1,1,120) - [===
RSISlope Filter ===]UseRSISlopeFilter=false// Require MinRSISlope(false/true) - [===
RSISlope Filter ===]MinRSISlope=0.5// MinRSISlope(abs Δ) (0.2,0.1,5.0) - [=== Bar Quality Filter ===]
UseBarQualityFilter=false// Enforce Candle StructureQuality(false/true) - [=== Bar Quality Filter ===]
MinBodyToRangeRatio=0.45// Min Body / Total RangeRatio(0.30,0.10,0.90) - [=== Bar Quality Filter ===]
MaxUpperWickRatioForBuy=0.40// Max Upper Wick /Range(BUY) (0.50,0.05,0.90) - [=== Bar Quality Filter ===]
MaxLowerWickRatioForSell=0.40// Max Lower Wick /Range(SELL) (0.50,0.05,0.90) - [=== Bar Quality Filter ===]
MinBodyPoints=5.0// Minimum CandleBody(pts) (2.0,1.0,50.0) - [=== Spread & Session Guards ===]
SpreadCapMode=SPREAD_MEDIAN_MULT// Spread CapMode(0,1,1) - [=== Spread & Session Guards ===]
FixedSpreadCapPoints= 35 // Fixed Spread CapPoints(10,1,80) - [=== Spread & Session Guards ===]
MedianWindowSize= 211 // MedianWindow(50,10,500) - [=== Spread & Session Guards ===]
MedianMultiplier=3.0// MedianMultiplier(1.5,0.5,5.0) - [=== Spread & Session Guards ===]
EnableSessionFilter=true// Enable SessionFilter(false/true) - [=== Spread & Session Guards ===]
Session1StartHour= 7 // Session1 StartHour(0,1,23) - [=== Spread & Session Guards ===]
Session1EndHour= 22 // Session1 EndHour(0,1,23) - [=== Spread & Session Guards ===]
EnableSession2=false// Enable SecondSession(false/true) - [=== Spread & Session Guards ===]
Session2StartHour= 0 // Session2 StartHour(0,1,23) - [=== Spread & Session Guards ===]
Session2EndHour= 0 // Session2 EndHour(0,1,23) - [=== Spread & Session Guards ===]
MaxSlippagePoints= 5 // MaxSlippage(1,1,10) - [=== Risk &
SLTPSettings ===]UseRiskPercent=false// Use Risk %Sizing(false/true) - [=== Risk &
SLTPSettings ===]RiskPercent=1.0// Risk Percent PerTrade(0.5,0.5,5.0) - [=== Risk &
SLTPSettings ===]FixedLot=0.10// Fixed LotSize(0.01,0.01,1.00) - [=== Risk &
SLTPSettings ===]UseATRforSLTP=false// UseATRfor SL/TP(false/true) - [=== Risk &
SLTPSettings ===] ATRPeriod = 14 //ATRPeriod(5,1,40) - [=== Risk &
SLTPSettings ===] ATR_SL_Mult =3.0//ATRStopMultiplier(1.0,0.5,6.0) - [=== Risk &
SLTPSettings ===] ATR_TP_Mult =6.0//ATRTakeProfitMultiplier(2.0,0.5,12.0) - [=== Risk &
SLTPSettings ===]StopLossPoints= 300 // FixedStopLossPoints(50,10,800) - [=== Risk &
SLTPSettings ===]TakeProfitPoints= 600 // FixedTakeProfitPoints(100,10,1600) - [=== Dynamic Lock
Profit(DLP) ===]InpEnableDynamicLockProfit=true// Enable Dynamic LockProfit(false/true) - [=== Dynamic Lock
Profit(DLP) ===]InpLockProfitEveryXPoints= 150 // Lock Profit StepPoints(50,10,500) - [=== Dynamic Lock
Profit(DLP) ===]InpLockMinusYPointsBuffer= 20 // Lock BufferSubtracted(5,5,100) - [=== Initial vs Additional Entries ===]
MaxOpenTrades= 5 // Maximum Open TradesTotal(1,1,20) - [=== Initial vs Additional Entries ===]
AllowOnlyProfitableAdditions=true// Require Existing Profits forAdds(false/true) - [=== Initial vs Additional Entries ===]
MinProfitPerTradeToAdd=5.0// MinProfit(pts) ForAdding(2.0,1.0,30.0) - [=== Pause / Trade Suspension Guards ===]
PauseOnConsecutiveLosses=false// Pause After XLosses(false/true) - [=== Pause / Trade Suspension Guards ===]
PauseConsecutiveLossesCount= 3 // Loss Streak TriggerCount(2,1,10) - [=== Pause / Trade Suspension Guards ===]
PauseConsecutiveLossesMinutes= 60 // Pause Minutes AfterStreak(15,5,240) - [=== Pause / Trade Suspension Guards ===]
PauseOnLossAmount=false// Pause On LossAmount(false/true) - [=== Pause / Trade Suspension Guards ===]
PauseLossAmount=100.0// Loss AmountTrigger(50,25,1000) - [=== Pause / Trade Suspension Guards ===]
PauseLossAmountMinutes= 60 // Pause Minutes AfterAmount(15,5,240) - [=== Logging & Diagnostics ===]
DebugLogs=true// Enable DebugLogs(false/true) - [=== Logging & Diagnostics ===]
InfoLogs=true// Enable InfoLogs(false/true) - [=== Logging & Diagnostics ===]
WarnLogs=true// Enable WarningLogs(false/true)
// Pipsgrowth EX12047 MultiIndicatorConfluence — Execution Flow (from source analysis)
// Family: MultiIndicatorConfluence
// Robust MA-cross EA with Dynamic Lock Profit step-ratchet, initial vs additional trade tagging, pause guards on consecutive losses, ECN-safe order wrappers, and multi-filter confirmations (RSI, ADX, MA separation, slope, HTF trend, ATR, range, bar quality, cooldown). 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 |
|---|---|---|
| MagicNumber | 22212047 | Expert Magic Number (55000,1,56000) |
| InpTradeComment | "Psgrowth.com Expert_12047" | Order Comment Prefix ("EA","","EA") |
| AllowBuyTrades | true | Enable BUY Trades (false/true) |
| AllowSellTrades | true | Enable SELL Trades (false/true) |
| FastMAPeriod | 20 | Fast MA Period (5,1,100) |
| SlowMAPeriod | 50 | Slow MA Period (10,1,200) |
| MaMethod | MODE_SMA | MA Method (not optimized) |
| MaPrice | 1 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MA Applied Price (not optimized) |
| SignalOncePerBar | true | One Signal Per Bar (false/true) |
| UseRSIFilter | false | Enable RSI Filter (false/true) |
| RSIPeriod | 14 | RSI Period (5,1,30) |
| RSI_BuyMin | 55 | BUY: Min RSI (40,1,70) |
| RSI_BuyOverbought | 90 | BUY: Overbought cap (70,1,99) |
| RSI_SellMax | 45 | SELL: Max RSI (30,1,60) |
| RSI_SellOversold | 20 | SELL: Oversold floor (1,1,30) |
| UseADXFilter | false | Enable ADX Strength Filter (false/true) |
| ADXPeriod | 14 | ADX Period (5,1,30) |
| ADX_Min | 20 | Minimum ADX Trend Strength (10,5,40) |
| UseTrendSlopeFilter | true | Require Slow MA Slope in Direction (false/true) |
| UseMASeparationFilter | false | Require Min Fast/Slow MA Separation (false/true) |
| MinMASeparationPoints | 10.0 | Min MA Separation (pts) (5.0,1.0,100.0) |
| UseSlopeMagnitudeFilter | false | Require Min Slow MA Slope Magnitude (false/true) |
| MinSlowMASlopePoints | 1.5 | Min Slow MA Slope (pts) (0.5,0.1,10.0) |
| UseHTFTrendFilter | false | Align With Higher TF Slow MA Slope (false/true) |
| HTFPeriod | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Higher TF For Trend Alignment (PERIOD_M15..PERIOD_D1) |
| UseATRVolatilityFilter | false | ATR Volatility Band Filter (false/true) |
| MinATRPoints | 20.0 | Min ATR (pts) (0 disables) (0,0,200) |
| MaxATRPoints | 0.0 | Max ATR (pts) (0 disables) (0,0,400) |
| UseRangeCompressionFilter | false | Block If Recent Range Too Small (false/true) |
| RangeLookbackBars | 20 | Range Lookback Bars (10,5,200) |
| MinRangePoints | 80.0 | Min High-Low Range (pts) (30.0,10.0,500.0) |
| UsePostTradeCooldown | false | Cooldown After Any New Trade (false/true) |
| CooldownMinutes | 5 | Cooldown Minutes (1,1,120) |
| UseRSISlopeFilter | false | Require Min RSI Slope (false/true) |
| MinRSISlope | 0.5 | Min RSI Slope (abs Δ) (0.2,0.1,5.0) |
| UseBarQualityFilter | false | Enforce Candle Structure Quality (false/true) |
| MinBodyToRangeRatio | 0.45 | Min Body / Total Range Ratio (0.30,0.10,0.90) |
| MaxUpperWickRatioForBuy | 0.40 | Max Upper Wick / Range (BUY) (0.50,0.05,0.90) |
| MaxLowerWickRatioForSell | 0.40 | Max Lower Wick / Range (SELL) (0.50,0.05,0.90) |
| MinBodyPoints | 5.0 | Minimum Candle Body (pts) (2.0,1.0,50.0) |
| SpreadCapMode | SPREAD_MEDIAN_MULT | Spread Cap Mode (0,1,1) |
| FixedSpreadCapPoints | 35 | Fixed Spread Cap Points (10,1,80) |
| MedianWindowSize | 211 | Median Window (50,10,500) |
| MedianMultiplier | 3.0 | Median Multiplier (1.5,0.5,5.0) |
| EnableSessionFilter | true | Enable Session Filter (false/true) |
| Session1StartHour | 7 | Session1 Start Hour (0,1,23) |
| Session1EndHour | 22 | Session1 End Hour (0,1,23) |
| EnableSession2 | false | Enable Second Session (false/true) |
| Session2StartHour | 0 | Session2 Start Hour (0,1,23) |
| Session2EndHour | 0 | Session2 End Hour (0,1,23) |
| MaxSlippagePoints | 5 | Max Slippage (1,1,10) |
| UseRiskPercent | false | Use Risk % Sizing (false/true) |
| RiskPercent | 1.0 | Risk Percent Per Trade (0.5,0.5,5.0) |
| FixedLot | 0.10 | Fixed Lot Size (0.01,0.01,1.00) |
| UseATRforSLTP | false | Use ATR for SL/TP (false/true) |
| ATRPeriod | 14 | ATR Period (5,1,40) |
| ATR_SL_Mult | 3.0 | ATR Stop Multiplier (1.0,0.5,6.0) |
| ATR_TP_Mult | 6.0 | ATR TakeProfit Multiplier (2.0,0.5,12.0) |
| StopLossPoints | 300 | Fixed StopLoss Points (50,10,800) |
| TakeProfitPoints | 600 | Fixed TakeProfit Points (100,10,1600) |
| InpEnableDynamicLockProfit | true | Enable Dynamic Lock Profit (false/true) |
| InpLockProfitEveryXPoints | 150 | Lock Profit Step Points (50,10,500) |
| InpLockMinusYPointsBuffer | 20 | Lock Buffer Subtracted (5,5,100) |
| MaxOpenTrades | 5 | Maximum Open Trades Total (1,1,20) |
| AllowOnlyProfitableAdditions | true | Require Existing Profits for Adds (false/true) |
| MinProfitPerTradeToAdd | 5.0 | Min Profit (pts) For Adding (2.0,1.0,30.0) |
| PauseOnConsecutiveLosses | false | Pause After X Losses (false/true) |
| PauseConsecutiveLossesCount | 3 | Loss Streak Trigger Count (2,1,10) |
| PauseConsecutiveLossesMinutes | 60 | Pause Minutes After Streak (15,5,240) |
| PauseOnLossAmount | false | Pause On Loss Amount (false/true) |
| PauseLossAmount | 100.0 | Loss Amount Trigger (50,25,1000) |
| PauseLossAmountMinutes | 60 | Pause Minutes After Amount (15,5,240) |
| DebugLogs | true | Enable Debug Logs (false/true) |
| InfoLogs | true | Enable Info Logs (false/true) |
| WarnLogs | true | Enable Warning Logs (false/true) |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX12047 ex14_1_1 — MA-cross EA with DLP, pause guards and multi-filter confirmations, full 12-layer stack."
// Standard trade include (needed for trade structs/enums)
#include <Trade/Trade.mqh>
//-------------------------------//
// INPUTS //
//-------------------------------//
// 01 - Identification
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_HTFPeriod = PERIOD_H1;
ENUM_APPLIED_PRICE g_MaPrice = PRICE_CLOSE;
input group "=== Core Identification ==="
input int MagicNumber = 22212047; // Expert Magic Number (55000,1,56000)
input string InpTradeComment = "Psgrowth.com Expert_12047"; // Order Comment Prefix ("EA","","EA")
// 02 - Direction Permissions
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;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.