P
PipsGrowth
OtherOpen Source – Free

Pipsgrowth EX12048 MultiIndicatorConfluence

MT5 Expert Advisor (Open Source) · XAUUSD · M5, H1

Pipsgrowth.com EX12048 ex14 — MA-cross EA with DLP, hedging, pause guards and multi-filter confirmations, full 12-layer stack.

Overview

Pipsgrowth EX12048 MultiIndicatorConfluence is a 20/50 moving-average crossover system wired for a specific kind of grid-ish behaviour most EAs hide: it allows a BUY and a SELL basket to live on the same symbol at the same time, then tags every new entry as either Initial or Add#N, with the add counter resetting each time a fresh initial trade is opened in that direction. The hedge permission is on by default (AllowHedgeBothDirections=true), so the EA is not a net-direction system — it can be running two opposing pyramids simultaneously and the per-direction counters (g_addBuyNext, g_addSellNext) are tracked independently. That is the structural difference between EX12048 and a normal MA-cross EA, and it dictates almost every other design choice in the file.

The signal path starts in the Signal() function. It reads the current and previous value of a 20-period fast MA and a 50-period slow MA, both SMA on PRICE_CLOSE, and watches for a single-bar cross: crossUp when fast[1] <= slow[1] and fast[0] > slow[0], crossDown for the opposite case. That intent is then gated by UseTrendSlopeFilter=true, which compares slow0 to slow1: a BUY cross where the slow MA is flat or pointing down is dropped, and the symmetric rule applies to SELL crosses. The slope gate is the only always-on confirmation. Everything else is opt-in.

The confirmation chain runs in ConfirmationsPass() in a fixed order. First the trade-pause flag (g_tradePauseUntil, raised by the OnTradeTransaction guard), then the directional toggles (AllowBuyTrades / AllowSellTrades), then the spread cap, then the session filter, then the hedge restriction (which only fires when AllowHedgeBothDirections is set to false), then the RSI band or directional filter, then the ADX floor, then the additions profitability check, then the MaxOpenTrades ceiling. The hedge restriction is therefore conditional — when AllowHedgeBothDirections is true, the EA explicitly allows BUY and SELL positions to coexist, and ConfirmationsPass never blocks on the 'Opposite position exists' check. When AllowHedgeBothDirections is false the EA behaves like a normal net-direction system.

The additions gate is where the Initial/Add#N tagging earns its keep. After a signal has cleared every other filter, CountOpenPositions(intent) decides whether this is the first trade in that direction (isInitial=true, comment tag is 'Initial') or a follow-on pyramid trade (tag is 'Add#N' with N pulled from g_addBuyNext or g_addSellNext). AllowOnlyProfitableAdditions=true means the EA refuses to add to a losing direction: IsAllSameDirProfitableAtLeast walks every same-direction position and requires each one to be at least MinProfitPerTradeToAdd points in the green before any new add will go through. If even one same-direction position is underwater, the add is rejected with a debug log explaining which side failed the gate. This is what stops the hedge structure from turning into an uncontrolled averaging-into-a-loser trap — adds only happen into already-floating-in-profit legs.

The Dynamic Lock Profit step-ratchet runs every tick from the maintenance loop at the top of OnTick, well before any new signal is processed. ApplyDynamicLockProfitToPosition() reads the position's open price, computes movedPts as the bid- or ask-relative distance in points, divides by InpLockProfitEveryXPoints (default 150) and floors, then computes targetLockPts = steps * 150 - InpLockMinusYPointsBuffer (default 20). The candidate new SL is open + targetLockPts (or open - for sells). The ratchet is monotonic: if the new SL is at or below the existing SL on a BUY, the function returns without modifying anything. TP is left alone. ModifyPositionSLTP() then normalizes the new SL to tick size, enforces the broker's stops-level minimum distance, and issues a TRADE_ACTION_SLTP modify. The 32-entry per-position log throttle keeps the log file from flooding when a single position is being ratcheted each tick.

The pause guard is driven entirely from OnTradeTransaction. Every DEAL_ENTRY_OUT deal on the EA's magic + symbol adds dealProfit+swap+commission to g_lossStreakCount (count) and the absolute value to g_lossStreakAmt (amount). If pnl is non-negative both counters reset. The guards are opt-in: PauseOnConsecutiveLosses=false by default with PauseConsecutiveLossesCount=3 and PauseConsecutiveLossesMinutes=60, PauseOnLossAmount=false with PauseLossAmount=100 and PauseLossAmountMinutes=60. If both are enabled, the EA extends g_tradePauseUntil to the later of the two computed pause-end timestamps. The trigger reason logged is 'Count', 'Amount', or 'Count+Amount' depending on which condition fired. ConfirmationsPass checks now < g_tradePauseUntil and rejects the signal with a '[PAUSE] active' message until the window expires.

The order wrapper is a 3-mode fill fallback. SendOrderMarket() reads the broker's preferred SYMBOL_FILLING_MODE and builds a sequence starting with that mode, then appends FOK / IOC / RETURN in that order if they differ. For each mode it first attempts the order with SL and TP attached; on REQUOTE-style failure it retries the same mode without SL/TP, and if the deal goes through it sends a follow-up TRADE_ACTION_SLTP modify to attach the protective levels. This is the ECN-friendly path — FOK is tried first because some liquidity providers reject IOC during thin books. After the send, the function reads back the position ticket from PositionSelect(_Symbol), with a hedging fallback that walks PositionsTotal to find a position matching magic+symbol if the symbol select returns more than one match.

The SL/TP and sizing section has two modes selected by UseATRforSLTP. In the default fixed-points mode the inputs are StopLossPoints=300 and TakeProfitPoints=600, giving the canonical 1:2 risk-reward. In ATR mode the EA reads the ATR(14) handle, multiplies by ATR_SL_Mult=3.0 and ATR_TP_Mult=6.0 (still 1:2), and clamps each distance to the broker's stops level plus 5 points. Sizing is then computed by LotsForRisk(): with UseRiskPercent=false the function returns NormalizeVolume(FixedLot=0.10); with UseRiskPercent=true it computes perLotRisk from the SL distance via tickValue/tickSize, divides AccountInfoDouble(ACCOUNT_BALANCE)*RiskPercent/100 by that, and normalizes the result to the symbol's vol_min/vol_step/vol_max lattice. The volume is then sanity-checked against g_vol_min and the entry is aborted if the rounded result is too small.

The spread cap has two modes selected by SpreadCapMode. The default SPREAD_MEDIAN_MULT maintains a 211-slot ring buffer of (ask-bid)/point values (SpreadBufferAdd, called every tick), and the cap is median(buffer) * MedianMultiplier=3.0. MedianSpread() copies the live samples into a temp array and ArraySorts them — if the count is odd it returns the middle element, if even it averages the two middle elements. The fallback SPREAD_FIXED mode uses FixedSpreadCapPoints=35 unconditionally. The median-multiplier mode is the production setting: it adapts to the broker's normal spread regime and refuses to fire during the spike clusters that hit a 5-tick candle or a thin Asian session rollover.

The session filter is two windows. Session1 is 7:00-22:00 server time and is enabled by default. Session2 is 0/0 and disabled (EnableSession2=false). The TimeInSessions helper handles wrap-around: if Session1StartHour <= Session1EndHour the check is the standard in-interval test, otherwise it accepts anything in [start, 24) U [0, end). When EnableSessionFilter is false the function returns true unconditionally and the EA trades 24/5. There is no Friday early-close, no JPY-specific news block, no candle-quality check — the session filter is the only time-of-day gate.

What is notably absent: there is no OnTester() function in the source, despite the brief claiming a 12th 'OnTester' layer. The advertised 12 layers collapse to 11 wired layers. There is no bar-quality check, no Heiken Ashi filter, no Fibonacci confluence, no wick/candle/spike gating, no dynamic profit lock independent of the DLP step ratchet, no market-close protection, no Friday close-all. The MapAppliedPriceInt function and the g_MaPrice global are declared once per input group, which is a copy-paste artifact — the compiler silently uses the last declaration. Compared to the heavier EX12046/47 builds, EX12048 is the leaner hedge-capable variant: the same MA-cross + DLP + tagging skeleton with the hedged-pyramid structure exposed via AllowHedgeBothDirections and a cleaner OnTradeTransaction pause guard.

Strategy Deep Dive

Every tick begins with a maintenance pass that walks PositionsTotal, picks up only positions matching the EA's magic+symbol, and feeds each into ApplyDynamicLockProfitToPosition(), which measures bid-or-ask distance from open, floors the result into 150-point steps, subtracts the 20-point buffer, and tightens the stop on monotonic-only changes via ModifyPositionSLTP. The current spread (ask-bid)/point is then pushed into a 211-slot ring buffer. On a new bar (g_lastBarTime guard when SignalOncePerBar is on) Signal() reads fast0/fast1/slow0/slow1 from the iMA handles, looks for the single-bar cross, and applies UseTrendSlopeFilter. ConfirmationsPass() then runs the trade-pause guard, directional toggles, the median-or-fixed spread cap, the 7:00-22:00 server-time session, the hedge restriction, the optional RSI/ADX filters, the additions-profitability gate, and the MaxOpenTrades ceiling. If everything passes, CountOpenPositions(intent) decides Initial vs Add#N, LotsForRisk computes size (FixedLot 0.10 default, or balance*RiskPercent-derived when UseRiskPercent is on), SL/TP are computed in points and normalized to tick size with stops-level clamps, and SendOrderMarket runs the 3-mode fill fallback (preferred FOK/IOC/RETURN) with the ECN-style 'send-with-SLTP then retry-without then post-modify' pattern. OnTradeTransaction watches every DEAL_ENTRY_OUT deal and increments the loss-streak counter / amount, optionally pausing the EA for PauseConsecutiveLossesMinutes or PauseLossAmountMinutes when the configured thresholds trip; a non-negative deal resets both counters.

Entry Signal

BUY on a single-bar 20/50 SMA cross up, gated by the always-on slow-MA slope filter (slope must point up for the BUY cross to survive). SELL on the symmetric downward cross, also gated by the slow-MA slope direction. Every other confirmation — RSI directional band, ADX floor, spread cap, session window, hedge restriction, additions profitability, MaxOpenTrades — is layered on top of the cross in ConfirmationsPass before the order is sized and sent.

Exit Signal

Exits are pure SL/TP — fixed 300/600 points in the default config (1:2 R:R) or ATR-scaled 3.0x ATR for SL and 6.0x ATR for TP when UseATRforSLTP is on. The DLP step ratchet in ApplyDynamicLockProfitToPosition() tightens the stop on a 150/-20 point grid (default) but never closes a position by itself. Positions hit SL or TP via the broker; the EA does not run a reverse-signal close, time exit, or Friday basket flush.

Stop Loss

Fixed StopLossPoints=300 points by default, or max(ATR(14)3.0, broker-stops-level+5) points when UseATRforSLTP=true. Applied as the initial stop on the order ticket, then the DLP ratchet tightens it on a 150-point step grid (targetLockPts = steps150 - 20 buffer) but never loosens.

Take Profit

Fixed TakeProfitPoints=600 points by default (1:2 R:R vs the 300 SL), or max(ATR(14)*6.0, broker-stops-level+5) points when UseATRforSLTP=true. TP is set on the order ticket and is not modified by the DLP ratchet — only the stop is ratcheted.

Best For

Traders running a hedged, dual-basket XAUUSD M5/H1 strategy who want per-direction Initial/Add#N pyramid tagging and the option to add only into already-floating-in-profit legs. Minimum balance $100 on a 0.10-lot FixedLot basis; raise to $500-$1,000 if UseRiskPercent=true is enabled. Requires an ECN/RAW-spread broker — the median-multiplier spread cap (211-tick ring buffer, 3.0x) will reject entries on any broker whose spikes routinely clear 3x its own median. The 7:00-22:00 server-time session filter is the only time-of-day gate, so confirm the server clock matches the active FX session you actually want to trade.

Strategy Logic

Pipsgrowth EX12048 MultiIndicatorConfluence — Strategy Logic Analysis (from .mq5 source)

Family: MultiIndicatorConfluence Magic: 22212048 Version: 2.00

BRIEF: Robust MA-cross EA with Dynamic Lock Profit step-ratchet, initial vs additional trade tagging, hedging permissions, pause guards on consecutive losses, ECN-safe order wrappers, and multi-filter confirmations (RSI directional, ADX, slope). 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester

INDICATOR STACK:

  • Standard MT5 indicators

KEY FUNCTIONS:

  • Log()
  • LogI()
  • LogD()
  • LogW()
  • NormalizeVolume()
  • PipValuePerLotForDistance()
  • LotsForRisk()
  • TimeInSessions()
  • SpreadBufferInitIfNeeded()
  • SpreadBufferAdd()
  • MedianSpread()
  • CurrentSpreadPoints()
  • ...and 19 more

INTERNAL CONSTANTS (0 total):

INPUT PARAMETERS (58 total across 9 groups):

  • [=== Core Identification ===] MagicNumber = 22212048 // Expert Magic Number (55000,1,56000)
  • [=== Core Identification ===] InpTradeComment = "Psgrowth.com Expert_12048" // Order Comment Prefix ("EA","","EA")
  • [=== Direction & Hedging ===] AllowBuyTrades = true // Enable BUY Trades (false/true)
  • [=== Direction & Hedging ===] AllowSellTrades = true // Enable SELL Trades (false/true)
  • [=== Direction & Hedging ===] AllowHedgeBothDirections = true // Allow Both Directions (false/true)
  • [=== Signal & Indicator Filters ===] FastMAPeriod = 20 // Fast MA Period (5,1,100)
  • [=== Signal & Indicator Filters ===] SlowMAPeriod = 50 // Slow MA Period (10,1,200)
  • [=== Signal & Indicator Filters ===] MaMethod = MODE_SMA // MA Method (not optimized)
  • [=== Signal & Indicator Filters ===] MaPrice = 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MA Applied Price (not optimized)
  • [=== Signal & Indicator Filters ===] SignalOncePerBar = true // One Signal Per Bar (false/true)
  • [=== Signal & Indicator Filters ===] UseRSIFilter = false // Enable RSI Filter (false/true)
  • [=== Signal & Indicator Filters ===] RSIPeriod = 14 // RSI Period (5,1,30)
  • [=== Signal & Indicator Filters ===] RSI_Min = 20 // RSI Minimum Threshold (10,5,40)
  • [=== Signal & Indicator Filters ===] RSI_Max = 80 // RSI Maximum Threshold (60,5,90)
  • [=== Signal & Indicator Filters ===] UseRSIDirectional = true // Directional RSI Mode (false/true)
  • [=== Signal & Indicator Filters ===] RSI_BuyMin = 55 // BUY: Min RSI (40,1,70)
  • [=== Signal & Indicator Filters ===] RSI_BuyOverbought = 90 // BUY: Overbought cap (70,1,99)
  • [=== Signal & Indicator Filters ===] RSI_SellMax = 45 // SELL: Max RSI (30,1,60)
  • [=== Signal & Indicator Filters ===] RSI_SellOversold = 20 // SELL: Oversold floor (1,1,30)
  • [=== Signal & Indicator Filters ===] UseADXFilter = false // Enable ADX Strength Filter (false/true)
  • [=== Signal & Indicator Filters ===] ADXPeriod = 14 // ADX Period (5,1,30)
  • [=== Signal & Indicator Filters ===] ADX_Min = 20 // Minimum ADX Trend Strength (10,5,40)
  • [=== Signal & Indicator Filters ===] UseTrendSlopeFilter = true // Require Slow MA Slope in Direction (false/true)
  • [=== Spread & Session Guards ===] SpreadCapMode = SPREAD_MEDIAN_MULT // Spread Cap Mode (0,1,1)
  • [=== Spread & Session Guards ===] FixedSpreadCapPoints = 35 // Fixed Spread Cap Points (10,1,80)
  • [=== Spread & Session Guards ===] MedianWindowSize = 211 // Median Window (50,10,500)
  • [=== Spread & Session Guards ===] MedianMultiplier = 3.0 // Median Multiplier (1.5,0.5,5.0)
  • [=== Spread & Session Guards ===] EnableSessionFilter = true // Enable Session Filter (false/true)
  • [=== Spread & Session Guards ===] Session1StartHour = 7 // Session1 Start Hour (0,1,23)
  • [=== Spread & Session Guards ===] Session1EndHour = 22 // Session1 End Hour (0,1,23)
  • [=== Spread & Session Guards ===] EnableSession2 = false // Enable Second Session (false/true)
  • [=== Spread & Session Guards ===] Session2StartHour = 0 // Session2 Start Hour (0,1,23)
  • [=== Spread & Session Guards ===] Session2EndHour = 0 // Session2 End Hour (0,1,23)
  • [=== Spread & Session Guards ===] MaxSlippagePoints = 5 // Max Slippage (1,1,10)
  • [=== Risk & SLTP Settings ===] UseRiskPercent = false // Use Risk % Sizing (false/true)
  • [=== Risk & SLTP Settings ===] RiskPercent = 1.0 // Risk Percent Per Trade (0.5,0.5,5.0)
  • [=== Risk & SLTP Settings ===] FixedLot = 0.10 // Fixed Lot Size (0.01,0.01,1.00)
  • [=== Risk & SLTP Settings ===] UseATRforSLTP = false // Use ATR for SL/TP (false/true)
  • [=== Risk & SLTP Settings ===] ATRPeriod = 14 // ATR Period (5,1,40)
  • [=== Risk & SLTP Settings ===] ATR_SL_Mult = 3.0 // ATR Stop Multiplier (1.0,0.5,6.0)
  • [=== Risk & SLTP Settings ===] ATR_TP_Mult = 6.0 // ATR TakeProfit Multiplier (2.0,0.5,12.0)
  • [=== Risk & SLTP Settings ===] StopLossPoints = 300 // Fixed StopLoss Points (50,10,800)
  • [=== Risk & SLTP Settings ===] TakeProfitPoints = 600 // Fixed TakeProfit Points (100,10,1600)
  • [=== Dynamic Lock Profit (DLP) ===] InpEnableDynamicLockProfit = true // Enable Dynamic Lock Profit (false/true)
  • [=== Dynamic Lock Profit (DLP) ===] InpLockProfitEveryXPoints = 150 // Lock Profit Step Points (50,10,500)
  • [=== Dynamic Lock Profit (DLP) ===] InpLockMinusYPointsBuffer = 20 // Lock Buffer Subtracted (5,5,100)
  • [=== Initial vs Additional Entries ===] MaxOpenTrades = 5 // Maximum Open Trades Total (1,1,20)
  • [=== Initial vs Additional Entries ===] AllowOnlyProfitableAdditions = true // Require Existing Profits for Adds (false/true)
  • [=== Initial vs Additional Entries ===] MinProfitPerTradeToAdd = 5.0 // Min Profit (pts) For Adding (2.0,1.0,30.0)
  • [=== Pause / Trade Suspension Guards ===] PauseOnConsecutiveLosses = false // Pause After X Losses (false/true)
  • [=== Pause / Trade Suspension Guards ===] PauseConsecutiveLossesCount = 3 // Loss Streak Trigger Count (2,1,10)
  • [=== Pause / Trade Suspension Guards ===] PauseConsecutiveLossesMinutes = 60 // Pause Minutes After Streak (15,5,240)
  • [=== Pause / Trade Suspension Guards ===] PauseOnLossAmount = false // Pause On Loss Amount (false/true)
  • [=== Pause / Trade Suspension Guards ===] PauseLossAmount = 100.0 // Loss Amount Trigger (50,25,1000)
  • [=== Pause / Trade Suspension Guards ===] PauseLossAmountMinutes = 60 // Pause Minutes After Amount (15,5,240)
  • [=== Logging & Diagnostics ===] DebugLogs = true // Enable Debug Logs (false/true)
  • [=== Logging & Diagnostics ===] InfoLogs = true // Enable Info Logs (false/true)
  • [=== Logging & Diagnostics ===] WarnLogs = true // Enable Warning Logs (false/true)
Pseudocode
// Pipsgrowth EX12048 MultiIndicatorConfluence — Execution Flow (from source analysis)
// Family: MultiIndicatorConfluence
// Robust MA-cross EA with Dynamic Lock Profit step-ratchet, initial vs additional trade tagging, hedging permissions, pause guards on consecutive losses, ECN-safe order wrappers, and multi-filter confirmations (RSI directional, ADX, slope). 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

Optimized Brokers:
ExnessIC Markets
Optimized Symbols:
XAUUSD
Optimized Timeframes:
M5H1

How to Install This EA on MT5

  1. 1Download the .mq5 file using the button above
  2. 2Open MetaTrader 5 on your computer
  3. 3Click File → Open Data Folder in the top menu
  4. 4Navigate to MQL5 → Experts and paste the .mq5 file there
  5. 5In MT5, right-click Expert Advisors in the Navigator panel → Refresh
  6. 6Drag the EA onto a chart matching the recommended timeframe
  7. 7Configure parameters according to the table on this page
  8. 8Enable Allow Algo Trading and click OK

EA Parameters

ParameterDefaultDescription
MagicNumber22212048Expert Magic Number (55000,1,56000)
InpTradeComment"Psgrowth.com Expert_12048"Order Comment Prefix ("EA","","EA")
AllowBuyTradestrueEnable BUY Trades (false/true)
AllowSellTradestrueEnable SELL Trades (false/true)
AllowHedgeBothDirectionstrueAllow Both Directions (false/true)
FastMAPeriod20Fast MA Period (5,1,100)
SlowMAPeriod50Slow MA Period (10,1,200)
MaMethodMODE_SMAMA Method (not optimized)
MaPrice1Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MA Applied Price (not optimized)
SignalOncePerBartrueOne Signal Per Bar (false/true)
UseRSIFilterfalseEnable RSI Filter (false/true)
RSIPeriod14RSI Period (5,1,30)
RSI_Min20RSI Minimum Threshold (10,5,40)
RSI_Max80RSI Maximum Threshold (60,5,90)
UseRSIDirectionaltrueDirectional RSI Mode (false/true)
RSI_BuyMin55BUY: Min RSI (40,1,70)
RSI_BuyOverbought90BUY: Overbought cap (70,1,99)
RSI_SellMax45SELL: Max RSI (30,1,60)
RSI_SellOversold20SELL: Oversold floor (1,1,30)
UseADXFilterfalseEnable ADX Strength Filter (false/true)
ADXPeriod14ADX Period (5,1,30)
ADX_Min20Minimum ADX Trend Strength (10,5,40)
UseTrendSlopeFiltertrueRequire Slow MA Slope in Direction (false/true)
SpreadCapModeSPREAD_MEDIAN_MULTSpread Cap Mode (0,1,1)
FixedSpreadCapPoints35Fixed Spread Cap Points (10,1,80)
MedianWindowSize211Median Window (50,10,500)
MedianMultiplier3.0Median Multiplier (1.5,0.5,5.0)
EnableSessionFiltertrueEnable Session Filter (false/true)
Session1StartHour7Session1 Start Hour (0,1,23)
Session1EndHour22Session1 End Hour (0,1,23)
EnableSession2falseEnable Second Session (false/true)
Session2StartHour0Session2 Start Hour (0,1,23)
Session2EndHour0Session2 End Hour (0,1,23)
MaxSlippagePoints5Max Slippage (1,1,10)
UseRiskPercentfalseUse Risk % Sizing (false/true)
RiskPercent1.0Risk Percent Per Trade (0.5,0.5,5.0)
FixedLot0.10Fixed Lot Size (0.01,0.01,1.00)
UseATRforSLTPfalseUse ATR for SL/TP (false/true)
ATRPeriod14ATR Period (5,1,40)
ATR_SL_Mult3.0ATR Stop Multiplier (1.0,0.5,6.0)
ATR_TP_Mult6.0ATR TakeProfit Multiplier (2.0,0.5,12.0)
StopLossPoints300Fixed StopLoss Points (50,10,800)
TakeProfitPoints600Fixed TakeProfit Points (100,10,1600)
InpEnableDynamicLockProfittrueEnable Dynamic Lock Profit (false/true)
InpLockProfitEveryXPoints150Lock Profit Step Points (50,10,500)
InpLockMinusYPointsBuffer20Lock Buffer Subtracted (5,5,100)
MaxOpenTrades5Maximum Open Trades Total (1,1,20)
AllowOnlyProfitableAdditionstrueRequire Existing Profits for Adds (false/true)
MinProfitPerTradeToAdd5.0Min Profit (pts) For Adding (2.0,1.0,30.0)
PauseOnConsecutiveLossesfalsePause After X Losses (false/true)
PauseConsecutiveLossesCount3Loss Streak Trigger Count (2,1,10)
PauseConsecutiveLossesMinutes60Pause Minutes After Streak (15,5,240)
PauseOnLossAmountfalsePause On Loss Amount (false/true)
PauseLossAmount100.0Loss Amount Trigger (50,25,1000)
PauseLossAmountMinutes60Pause Minutes After Amount (15,5,240)
DebugLogstrueEnable Debug Logs (false/true)
InfoLogstrueEnable Info Logs (false/true)
WarnLogstrueEnable Warning Logs (false/true)
Source Code (.mq5)Open Source
Pipsgrowth_com_EX12048.mq5
#property copyright "Pipsgrowth.com"
#property link      "https://pipsgrowth.com"
#property version   "2.00"
#property strict
#property description "Pipsgrowth.com EX12048 ex14 — MA-cross EA with DLP, hedging, 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_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_APPLIED_PRICE g_MaPrice = PRICE_CLOSE;
input group "=== Core Identification ==="
input int      MagicNumber          = 22212048;   // Expert Magic Number (55000,1,56000)
input string   InpTradeComment   = "Psgrowth.com Expert_12048";    // Order Comment Prefix ("EA","","EA")

// 02 - Direction & Hedging Permissions
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_APPLIED_PRICE g_MaPrice = PRICE_CLOSE;
input group "=== Direction & Hedging ==="
input bool     AllowBuyTrades             = true;  // Enable BUY Trades (false/true)
input bool     AllowSellTrades            = true;  // Enable SELL Trades (false/true)
input bool     AllowHedgeBothDirections   = true;  // Allow Both Directions (false/true)

// 03 - Signal & Indicator Filters (entry generation + indicator confirmations)
ENUM_APPLIED_PRICE MapAppliedPriceInt(int ap)
{
   switch(ap)
   {
      case 1: return PRICE_CLOSE;

Full source code available on download

Educational purposes only. Do NOT use with real money. Test on demo accounts only.

Tags:ex12048multiindicatorconfluencepipsgrowthfreemt5xauusd

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

Community

Sign in to contributeSign In

Educational purposes only. Do NOT use with real money. Test on demo accounts only.

File NamePipsgrowth_com_EX12048.mq5
File Size43.6 KB
Versionv2.00
PlatformMetaTrader 5
File Type.mq5 Source
StrategyOther
Risk LevelMedium Risk
Timeframes
M5H1
Currency Pairs
XAUUSD
Min. Deposit$100