P
PipsGrowth
BreakoutOpen Source – Free

Pipsgrowth EX02027 Breakout

MT5 Expert Advisor (Open Source) · EURUSD, USDJPY, GBPUSD, AUDUSD · M1

Pipsgrowth.com EX02027 EX8 Multi-Symbol VWAP+KAMA Donchian — multi-symbol scalper with ADX regime switch, full 12-layer stack.

Overview

Pipsgrowth EX02027 is the only EA in the EX02 family that was designed to scale a single strategy across many symbols at once. The headline feature is the SymbolsCSV input, which is parsed in OnInit by SplitCSV() and stored into the g_syms[] array (capped at 20 entries by the MAX_SYMS define). Every signal-evaluation function — TryEntriesSymbol(), HandleKAMA(), HandleRSI2(), HandleADX(), HandleATR(), ComputeSessionVWAP(), DonchLevels(), ComputeSuperTrend() — runs once per registered symbol on a single timer-driven loop, and each symbol owns an independent state record (lastBarTraded, lastBuyTime, lastSellTime, tradePauseUntil, lossStreakCount, addCountBuy, addCountSell, plus its own spread buffer and four indicator handles). The default comma list is EURUSD, USDJPY, GBPUSD, EURJPY, AUDUSD, but a user can replace any subset by editing one input line. The trade comment is suffixed "Initial" for the first position in a direction and "Add#1", "Add#2", etc. for scaling entries, which makes broker-statement auditing of how the EA scaled into a setup trivial.

The second distinctive idea is an ADX-driven regime switcher implemented in TryEntriesSymbol(). On every timer tick the EA pulls the latest ADX(14) value (handle created by HandleADX()) and compares it to the user-tunable InpADXSwitch (default 18). When ADX reads below the switch, isMR is set true and the EA trades a mean-reversion playbook. When ADX reads at or above the switch, isMR is false and the EA trades a breakout playbook. The two playbooks share infrastructure (KAMA slope, VWAP, confirmations, ATR percentile gate) but use different entry triggers, different SL/TP multiples, and a different role for VWAP.

In the mean-reversion playbook the price is read against a session-anchored VWAP that is recomputed bar-by-bar in ComputeSessionVWAP(). The function walks back from the current bar to the broker's day boundary (or up to InpVWAP_StdLookback = 60 bars, whichever is shorter), accumulates Σ(typical_price × volume) and Σ(volume), divides to get VWAP, then runs a Welford pass to compute σ of typical price around VWAP. A long-MR signal requires that the closed bar's close dipped to or below vwap − InpVWAP_SigmaOuter × sigma (the outer 2.0σ band by default), that the 2-period RSI has just crossed back above InpRSI2_LevelLow = 10 (i.e. an oversold recapture via RSI_Recapture()), that the KAMA(10, 2, 30) slope is non-negative (KAMA_SlopeAgree()), and that the bar has a body/range of at least InpMinBodyToRange = 0.18 (BarQualityOK()). The mirror logic fires shorts against the upper 2σ band. In mean-reversion the role of VWAP is therefore a fair-value anchor — entries only happen at extreme deviations from it.

In the breakout playbook VWAP switches from being the price target to being a proximity filter. The EA reads the Donchian channel over InpDonchianPeriod = 20 bars in DonchLevels(), then walks the SuperTrend in ComputeSuperTrend() (ATR period 10, multiplier 2.0 — both user-adjustable) to determine if the structural trend is bullish or bearish. A long-BO signal needs close > upper Donchian band AND SuperTrend bullish AND KAMA slope non-negative; a short-BO signal needs close < lower Donchian AND SuperTrend bearish AND KAMA non-positive. Once the breakout fires the EA computes a z-score of the close against the session VWAP and refuses the entry if |z| > 1.5 — a breakout that runs far from the day's fair value is treated as exhausted, not as a continuation.

After the directional signal is formed, the EA tallies confirmations. Each side gets a count of how many of three slots fire: VolumeSpikeOK() (current bar volume ≥ 1.30 × 20-bar SMA of volume), KAMA slope agreement, and VWAP availability (any sigma > 0 reading this bar). The total required is InpNeedConfirmationsK = 2 by default, and the active slot count is always exactly 3 (the EA refuses to start if K is set outside 0..3 in OnInit). If both long and short trigger the same bar, the side with more confirmations wins; on a tie both are dropped. A daily ATR-percentile gate in ATRPercentileOK() then sorts the bars-of-day ATR values, drops signals whose current ATR ranks below the 30th percentile (too quiet to trade) or above the 85th (too volatile to trust the SL distance), and after that applies a 20-second per-direction cooldown (InpCooldownSecondsDir) and a one-entry-per-bar gate (InpOneEntryPerBar).

SL and TP are mode-dependent. CalcSLTP() reads InpUseATRforSLTP (default true) and pulls GetATRPoints() (which divides the latest ATR(14) value by SymbolInfoDouble(SYMBOL_POINT)). For breakout entries the EA clamps the SL multiplier to a minimum of 1.0 and the TP multiplier to a minimum of 2.0 — the user-set InpATR_SL_Mult and InpATR_TP_Mult are therefore floors, not exact values. For mean-reversion entries the floors drop to 0.8 and 1.6. Both modes end up at roughly 1:2 risk-reward, but the MR path uses a tighter stop because it expects price to revert before travelling far. If ATR is disabled the EA falls back to InpSL_Points = 250 and InpTP_Points = 500 static points. Stops and targets are normalized to the symbol's tick size and submitted with the order; if the broker rejects them as too tight the order is resent without SL/TP and then a separate ModifyPositionSLTP() patch is applied.

Position management has three moving parts. The first is a dynamic lock-profit ratchet (ApplyDynamicLockProfitToPosition()) that runs on every tick for every open position. It measures how many whole InpLockProfitEveryXPoints (default 120) units of profit the position has accumulated, then moves the SL to (entry + steps × 120 − 18) points — the 18-point buffer is InpLockMinusYPointsBuffer, which prevents the ratchet from setting the SL on top of the entry by a single tick. The new SL is only ever set if it is further from entry than the current SL, so the lock is monotonic. The second is the scale-in gate, which the EA enforces inside CanPlaceNew() and IsAllSameDirProfitableAtLeast(). By default MaxOpenTradesPerSymbol is 2 and MaxTotalOpenTrades is 6; an "Add#" position can only be opened if all existing positions in that direction on the same symbol have ≥ MinProfitPerTradeToAdd = 4.0 points of unrealized profit. The third is the trade-pause guard, where OnTradeTransaction() watches every DEAL_ADD, and if the per-symbol loss streak hits PauseConsecutiveLossesCount = 3 (default OFF) or the accumulated loss in currency hits PauseLossAmount = 100.0 (default OFF), the EA writes a future timestamp into tradePauseUntil and refuses new entries on that symbol until the timestamp passes.

Capital protection mirrors the EX02 hardening convention. InpDailyLossLimitPct = 5% of initial balance is the daily kill switch; InpMaxTradesPerDay = 20 caps turnover; InpMaxConsecLosses = 5 raises a global 4-hour cooldown via g_cooldownUntil; InpMinEquityPct = 70% enforces a drawdown floor; InpCapAmount = 0 (disabled) would cap effective capital to a fixed amount, and InpCapFloor = 1000 prevents the EA from sizing against a tiny effective balance. Auto GMT offset detection (DetectGMTOffset_EX02027) scores candidate offsets in -12..+12 by weekday (Mon-Fri = 10 points) and trading-hour fit (07-21 GMT = 5 points) and uses the best score. The session filter (InpUseGMTSessions = false by default) is wired to London 07-16 GMT and New York 12-21 GMT. The news filter (InpFilterNews = true) blocks new entries ±InpNewsBufferMinutes = 30 minutes around any high-impact event pulled via CalendarValueHistory(). The market-open gate additionally refuses to trade from Sunday 22:00 GMT to Monday 22:00 GMT and from Friday 22:00 GMT onwards.

Order execution is robust. SendOrder_AllFillings() queries SymbolInfoInteger(SYMBOL_FILLING_MODE) to discover which of IOC, RETURN, or FOK the broker allows, then walks the allowed filling modes for up to 5 outer retries. Each outer retry increases the slippage deviation by 3 points up to InpMaxAdaptiveDeviation = 20. If a fill is rejected with TRADE_RETCODE_INVALID_STOPS the EA resubmits the same order with no SL/TP and patches the stops in afterwards via ModifyPositionSLTP(). OnTester returns (profit × profit-factor) / max-DD, gated by a minimum of 10 trades — a deliberately small threshold for an EA whose per-symbol trade count is naturally low because the ADX gate is selective.

The net character of the EA is a high-throughput, multi-symbol dispatcher that runs two completely different strategies on the same M1 bars, sharing only the confirmation stack, the SL/TP framework, and the position-management layer. Backtests that optimise per-symbol will get the most out of the design; single-symbol runs of EURUSD alone on M1 will simply see fewer signals and the DLP ratchet, but no performance loss from the multi-symbol infrastructure. Recommended minimum balance is the EA's own stated $100, but the dynamic spread cap and the per-symbol scale-in gate only make sense on accounts that can support two positions per symbol across four or five symbols simultaneously — i.e. roughly $5,000 of free margin at minimum lot size on a standard account.

Strategy Deep Dive

EX02027 is the multi-symbol engine in the EX02 family. OnInit parses the SymbolsCSV input into up to 20 entries, opens each one via SymbolSelect, and creates per-symbol indicator handles for KAMA(10, 2, 30), RSI(2), ADX(14), and ATR(14). A single timer-driven loop calls TryEntriesSymbol() for each registered symbol, and inside that function the latest ADX value routes the logic to either a mean-reversion playbook (close pierces session-VWAP outer 2σ band + RSI(2) recapture + KAMA slope agree) or a Donchian(20) breakout playbook (close beyond the channel + SuperTrend agreement + KAMA slope agree + VWAP proximity reject if z > 1.5). The 3-slot confirmation stack — volume spike, KAMA, VWAP — must clear InpNeedConfirmationsK = 2, then a daily ATR-percentile gate (30-85) and a 20-second per-direction cooldown filter the rest. SL is ATR-derived with mode-aware floors (1.0× in BO, 0.8× in MR), TP is mode-aware (2.0× in BO, 1.6× in MR) — both attached at order entry. The dynamic lock-profit ratchet walks the SL forward in 120-point steps minus an 18-point buffer, never backward. The trade-management layer also handles scale-in: MaxOpenTradesPerSymbol = 2 with AllowOnlyProfitableAdditions requires every existing same-direction position to show ≥ 4.0 points of unrealized profit before an "Add#" entry is allowed, and OnTradeTransaction() enforces a per-symbol loss-streak pause and a global 5-consecutive-loss 4-hour cooldown. Multi-filling order execution tries IOC → RETURN → FOK in turn, with adaptive deviation that grows from 5 to 20 points across the 5 outer retries. Auto GMT detection scores offsets in -12..+12 by weekday and trading-hour fit; the news filter blocks ±30 minutes around high-impact events; the daily loss limit is 5% of the initial balance.

Entry Signal

The EA reads ADX(14) every bar and routes to one of two playbooks: ADX below InpADXSwitch (default 18) fires a mean-reversion entry when the closed bar's close pierces the session-VWAP outer 2σ band and RSI(2) recaptures above 10 (or below 90 for shorts), with KAMA slope agreement and a body/range ≥ 0.18. ADX at or above the switch fires a Donchian(20) breakout that must also agree with SuperTrend(10, 2.0) and KAMA slope, and is rejected if the close is more than 1.5σ from the session VWAP. Either side must clear InpNeedConfirmationsK = 2 of 3 confirmation slots (volume spike ≥ 1.30× 20-bar average, KAMA slope, VWAP available) and pass the 30-85 daily ATR percentile band before a 20-second directional cooldown and a one-entry-per-bar gate apply.

Exit Signal

Exit comes from one of three paths. Fixed TP is the ATR-derived target — ATR(14) × 2.0 in breakout mode or × 1.6 in mean-reversion mode, normalized to the symbol's tick size — and is attached to the order at entry, not trailed into. The dynamic lock-profit ratchet (ApplyDynamicLockProfitToPosition()) tightens the stop-loss monotonically every 120 points of profit, leaving an 18-point buffer to keep the lock off the entry, and runs on every tick. The third exit path is the order comment-based scaling: when the EA opens an "Add#N" position in a direction, it does not close the existing ones — the original SL/TP and DLP ratchet continue to govern the older positions, and the new one is sized and SL/TP'd independently.

Stop Loss

Stop-loss is ATR-derived by CalcSLTP() and equals the latest ATR(14) value multiplied by InpATR_SL_Mult in breakout mode (floor 1.0, default 1.0) or by 0.8 in mean-reversion mode — the multipliers are mode-aware floors, not exact values. If ATR-based sizing is disabled, the EA falls back to a static InpSL_Points = 250 points. The dynamic lock-profit ratchet then tightens the SL monotonically as profit grows, so a position that reaches multiple 120-point profit steps will have its SL advanced to entry + (steps × 120 − 18) points and never relaxed.

Take Profit

Take-profit is mode-dependent and set at order entry, not trailed. In breakout mode the TP is ATR(14) × InpATR_TP_Mult (default 2.0, floor 2.0), giving a 1:2 risk-reward against the 1.0× ATR stop. In mean-reversion mode the TP is ATR(14) × 1.6 against the 0.8× ATR stop, which keeps the 1:2 RR while letting the EA use a tighter stop on a setup that is expected to revert before travelling far. If ATR is disabled the TP is a static InpTP_Points = 500 points.

Best For

Recommended minimum balance is $100, but the multi-symbol design only delivers its full payoff on accounts with at least $5,000 of free margin so that the 2-positions-per-symbol, 6-positions-global cap is reachable. Use a low-spread ECN/RAW broker — the dynamic spread cap is calibrated to median + 3 × MAD of the last 200 ticks and tolerates normal conditions, but a wide-spread broker will keep the EA permanently out of the market. Best in the London 7-16 GMT and New York 12-21 GMT windows if InpUseGMTSessions is enabled, otherwise the EA is permissive and the per-symbol loss-streak pause and the 4-hour consec-loss cooldown are what actually stop overnight bleed. Optimise per-symbol rather than across the whole list — the regime switcher and the VWAP session reset mean the same parameters do not suit all five default symbols.

Strategy Logic

Pipsgrowth EX02027 Breakout — Strategy Logic Analysis (from .mq5 source)

Family: Breakout Magic: 22202027 Version: 2.00

BRIEF: Multi-symbol VWAP+KAMA Donchian/SuperTrend scalper with ADX regime switching between mean-reversion and breakout modes, session VWAP sigma bands, RSI(2) recapture, dynamic lock profit

INDICATOR STACK:

  • Standard MT5 indicators

KEY FUNCTIONS:

  • Trim()
  • SplitCSV()
  • FindSymIndex()
  • SymPoint()
  • SymTickSize()
  • NormalizePriceToTick()
  • SymBid()
  • SymAsk()
  • SymbolMinVolume()
  • SymbolVolumeStep()
  • NormalizeVol()
  • TotalOpenPositionsAll()
  • ...and 44 more

INTERNAL CONSTANTS (0 total):

INPUT PARAMETERS (56 total across 12 groups):

  • [=== Core ===] MagicNumber = 22202027 // 2220 + Expert ID (333)
  • [=== Core ===] SymbolsCSV = "EURUSD,USDJPY,GBPUSD,EURJPY,AUDUSD" // Symbols list (CSV)
  • [=== Core ===] InpTF = 1 // Working timeframe (0=current,1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1,8=W1,9=MN1)
  • [=== Dynamic Lock Profit ===] InpEnableDynamicLockProfit = true // Enable dynamic lock profit ratchet
  • [=== Dynamic Lock Profit ===] InpLockProfitEveryXPoints = 120 // Lock step (points)
  • [=== Dynamic Lock Profit ===] InpLockMinusYPointsBuffer = 18 // Lock buffer subtract (points)
  • [=== Initial vs Additional ===] MaxOpenTradesPerSymbol = 2 // Max positions per symbol
  • [=== Initial vs Additional ===] MaxTotalOpenTrades = 6 // Global max open positions
  • [=== Initial vs Additional ===] AllowOnlyProfitableAdditions = true // Only add if prior direction profitable
  • [=== Initial vs Additional ===] MinProfitPerTradeToAdd = 4.0 // Min unrealized pts each to allow add
  • [=== Pause Guards ===] PauseOnConsecutiveLosses = false // Enable pause after X losses
  • [=== Pause Guards ===] PauseConsecutiveLossesCount = 3 // Loss streak threshold
  • [=== Pause Guards ===] PauseConsecutiveLossesMinutes = 60 // Pause duration (minutes)
  • [=== Pause Guards ===] PauseOnLossAmount = false // Enable pause after loss amount
  • [=== Pause Guards ===] PauseLossAmount = 100.0 // Loss amount threshold (currency)
  • [=== Pause Guards ===] PauseLossAmountMinutes = 60 // Pause duration after amount (minutes)
  • [=== Trade and Risk ===] InpUseAutoMinLot = true // Use symbol min lot automatically
  • [=== Trade and Risk ===] InpFixedLot = 0.10 // Fixed lot if auto-min disabled
  • [=== Trade and Risk ===] InpUseATRforSLTP = true // Use ATR-based SL/TP
  • [=== Trade and Risk ===] InpATRPeriod = 14 // ATR period
  • [=== Trade and Risk ===] InpATR_SL_Mult = 1.0 // Base ATR SL multiplier
  • [=== Trade and Risk ===] InpATR_TP_Mult = 2.0 // Base ATR TP multiplier
  • [=== Trade and Risk ===] InpSL_Points = 250 // Static SL if ATR disabled (points)
  • [=== Trade and Risk ===] InpTP_Points = 500 // Static TP if ATR disabled (points)
  • [=== Trade and Risk ===] InpSlippagePoints = 5 // Initial allowed slippage
  • [=== Trade and Risk ===] InpMaxAdaptiveDeviation = 20 // Max adaptive deviation (points)
  • [=== Trade and Risk ===] InpOneEntryPerBar = true // Restrict one entry per bar
  • [=== Trade and Risk ===] InpCooldownSecondsDir = 20 // Directional cooldown seconds
  • [=== Logic (Few Knobs) ===] InpADXSwitch = 18 // ADX regime switch threshold
  • [=== Logic (Few Knobs) ===] InpDonchianPeriod = 20 // Donchian channel period
  • [=== Logic (Few Knobs) ===] InpST_ATR_Period = 10 // SuperTrend ATR period
  • [=== Logic (Few Knobs) ===] InpST_Mult = 2.0 // SuperTrend ATR multiplier
  • [=== Logic (Few Knobs) ===] InpRSI2_LevelLow = 10 // RSI2 low recapture level (BUY)
  • [=== Logic (Few Knobs) ===] InpRSI2_LevelHigh = 90 // RSI2 high recapture level (SELL)
  • [=== Logic (Few Knobs) ===] InpVWAP_SigmaInner = 1.5 // VWAP inner sigma band
  • [=== Logic (Few Knobs) ===] InpVWAP_SigmaOuter = 2.0 // VWAP outer sigma band
  • [=== Logic (Few Knobs) ===] InpVWAP_StdLookback = 60 // VWAP sigma calc lookback
  • [=== Logic (Few Knobs) ===] InpNeedConfirmationsK = 2 // Required confirmations K
  • [=== Auto Filters ===] InpUseDynamicSpreadCap = true // Enable dynamic spread cap
  • [=== Auto Filters ===] InpSpreadLookbackTicks = 200 // Spread sampling window (ticks)
  • [=== Auto Filters ===] InpSpreadMADMult = 3.0 // Spread cap multiplier (med+k*MAD)
  • [=== Auto Filters ===] InpSpreadCapAbsPoints = 0 // Absolute spread cap (0=off)
  • [=== Auto Filters ===] InpMinTicksPerMin = 18 // Min tick activity per minute
  • [=== Auto Filters ===] InpUseBarQualityFilter = true // Use bar quality filter
  • [=== Auto Filters ===] InpMinBodyToRange = 0.18 // Min body/range ratio
  • [=== Auto Filters ===] InpUseATRPercentileFilter = true // Use ATR percentile gating
  • [=== Auto Filters ===] InpATRPctlLow = 30 // ATR percentile low bound
  • [=== Auto Filters ===] InpATRPctlHigh = 85 // ATR percentile high bound
  • [=== Performance ===] InpEvaluateOnNewBarOnly = true // Only run entry logic on new closed bar
  • [=== Performance ===] InpLightweightOptimization = true // Simplify heavy calcs during optimization
  • [=== Performance ===] InpTimerSeconds = 1 // Timer interval seconds
  • [=== Debug ===] InpDebugReasons = false // Log skip reasons (throttled per bar)
  • [=== GMT Session Filter (Hardening) ===] InpNewYorkEndGMT = 21 // --- Hardening: Capital Protection ---
  • [=== Capital Protection (Hardening) ===] InpCapAmount = 0.0 // Capital cap amount (0=disabled)
  • [=== Capital Protection (Hardening) ===] InpDailyLossLimitPct = 5.0 // --- Hardening: Trade Safety ---
  • [=== Trade Safety (Hardening) ===] InpNewsBufferMinutes = 30 // ==================================================================//
Pseudocode
// Pipsgrowth EX02027 Breakout — Execution Flow (from source analysis)
// Family: Breakout
// Multi-symbol VWAP+KAMA Donchian/SuperTrend scalper with ADX regime switching between mean-reversion and breakout modes, session VWAP sigma bands, RSI(2) recapture, dynamic lock profit

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:
EURUSDUSDJPYGBPUSDAUDUSD
Optimized Timeframes:
M1

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 an H1 or H4 chart
  7. 7Set the range detection period, breakout buffer, and lot size in the EA dialog
  8. 8Enable Allow Algo Trading and click OK

EA Parameters

ParameterDefaultDescription
MagicNumber222020272220 + Expert ID (333)
SymbolsCSV"EURUSD,USDJPY,GBPUSD,EURJPY,AUDUSD"Symbols list (CSV)
InpTF1Working timeframe (0=current,1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1,8=W1,9=MN1)
InpEnableDynamicLockProfittrueEnable dynamic lock profit ratchet
InpLockProfitEveryXPoints120Lock step (points)
InpLockMinusYPointsBuffer18Lock buffer subtract (points)
MaxOpenTradesPerSymbol2Max positions per symbol
MaxTotalOpenTrades6Global max open positions
AllowOnlyProfitableAdditionstrueOnly add if prior direction profitable
MinProfitPerTradeToAdd4.0Min unrealized pts each to allow add
PauseOnConsecutiveLossesfalseEnable pause after X losses
PauseConsecutiveLossesCount3Loss streak threshold
PauseConsecutiveLossesMinutes60Pause duration (minutes)
PauseOnLossAmountfalseEnable pause after loss amount
PauseLossAmount100.0Loss amount threshold (currency)
PauseLossAmountMinutes60Pause duration after amount (minutes)
InpUseAutoMinLottrueUse symbol min lot automatically
InpFixedLot0.10Fixed lot if auto-min disabled
InpUseATRforSLTPtrueUse ATR-based SL/TP
InpATRPeriod14ATR period
InpATR_SL_Mult1.0Base ATR SL multiplier
InpATR_TP_Mult2.0Base ATR TP multiplier
InpSL_Points250Static SL if ATR disabled (points)
InpTP_Points500Static TP if ATR disabled (points)
InpSlippagePoints5Initial allowed slippage
InpMaxAdaptiveDeviation20Max adaptive deviation (points)
InpOneEntryPerBartrueRestrict one entry per bar
InpCooldownSecondsDir20Directional cooldown seconds
InpADXSwitch18ADX regime switch threshold
InpDonchianPeriod20Donchian channel period
InpST_ATR_Period10SuperTrend ATR period
InpST_Mult2.0SuperTrend ATR multiplier
InpRSI2_LevelLow10RSI2 low recapture level (BUY)
InpRSI2_LevelHigh90RSI2 high recapture level (SELL)
InpVWAP_SigmaInner1.5VWAP inner sigma band
InpVWAP_SigmaOuter2.0VWAP outer sigma band
InpVWAP_StdLookback60VWAP sigma calc lookback
InpNeedConfirmationsK2Required confirmations K
InpUseDynamicSpreadCaptrueEnable dynamic spread cap
InpSpreadLookbackTicks200Spread sampling window (ticks)
InpSpreadMADMult3.0Spread cap multiplier (med+k*MAD)
InpSpreadCapAbsPoints0Absolute spread cap (0=off)
InpMinTicksPerMin18Min tick activity per minute
InpUseBarQualityFiltertrueUse bar quality filter
InpMinBodyToRange0.18Min body/range ratio
InpUseATRPercentileFiltertrueUse ATR percentile gating
InpATRPctlLow30ATR percentile low bound
InpATRPctlHigh85ATR percentile high bound
InpEvaluateOnNewBarOnlytrueOnly run entry logic on new closed bar
InpLightweightOptimizationtrueSimplify heavy calcs during optimization
InpTimerSeconds1Timer interval seconds
InpDebugReasonsfalseLog skip reasons (throttled per bar)
InpNewYorkEndGMT21--- Hardening: Capital Protection ---
InpCapAmount0.0Capital cap amount (0=disabled)
InpDailyLossLimitPct5.0--- Hardening: Trade Safety ---
InpNewsBufferMinutes30==================================================================//
Source Code (.mq5)Open Source
Pipsgrowth_com_EX02027.mq5
#property copyright "Pipsgrowth.com"
#property link      "https://pipsgrowth.com"
#property version   "2.00"
#property strict
#property description "Pipsgrowth.com EX02027 EX8 Multi-Symbol VWAP+KAMA Donchian — multi-symbol scalper with ADX regime switch, full 12-layer stack."

//==================================================================//
//                      TIMEFRAME MAPPING                            //
//==================================================================//
ENUM_TIMEFRAMES MapTimeframe_EX02027(int tf)
{
   switch(tf)
   {
      case 0:  return (ENUM_TIMEFRAMES)Period();
      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;
      case 8:  return PERIOD_W1;
      case 9:  return PERIOD_MN1;
      default: return PERIOD_M1;
   }
}

ENUM_TIMEFRAMES g_tf = PERIOD_M1;

//==================================================================//
//                              INPUTS                               //
//==================================================================//

input group "=== Core ==="
input long      MagicNumber           = 22202027; // 2220 + Expert ID (333)
input string    InpTradeComment       = "Psgrowth.com Expert_02027";
input string    SymbolsCSV            = "EURUSD,USDJPY,GBPUSD,EURJPY,AUDUSD"; // Symbols list (CSV)
input int       InpTF               = 1;       // Working timeframe (0=current,1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1,8=W1,9=MN1)

//------------------ DYNAMIC LOCK PROFIT (Ratchet) -------------------
input group "=== Dynamic Lock Profit ==="
input bool      InpEnableDynamicLockProfit = true;  // Enable dynamic lock profit ratchet
input int       InpLockProfitEveryXPoints  = 120;    // Lock step (points)
input int       InpLockMinusYPointsBuffer  = 18;     // Lock buffer subtract (points)

//-------------- INITIAL vs ADDITIONAL (adds gating) -----------------
input group "=== Initial vs Additional ==="
input int       MaxOpenTradesPerSymbol     = 2;     // Max positions per symbol
input int       MaxTotalOpenTrades         = 6;     // Global max open positions
input bool      AllowOnlyProfitableAdditions = true; // Only add if prior direction profitable
input double    MinProfitPerTradeToAdd     = 4.0;   // Min unrealized pts each to allow add

//--------------------------- PAUSE GUARDS ---------------------------
input group "=== Pause Guards ==="
input bool      PauseOnConsecutiveLosses      = false; // Enable pause after X losses
input int       PauseConsecutiveLossesCount   = 3;      // Loss streak threshold
input int       PauseConsecutiveLossesMinutes = 60;     // Pause duration (minutes)
input bool      PauseOnLossAmount             = false;  // Enable pause after loss amount
input double    PauseLossAmount               = 100.0;  // Loss amount threshold (currency)
input int       PauseLossAmountMinutes        = 60;     // Pause duration after amount (minutes)

Full source code available on download

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

Tags:ex02027breakoutpipsgrowthfreemt5eurusdusdjpygbpusdaudusd

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_EX02027.mq5
File Size51.1 KB
Versionv2.00
PlatformMetaTrader 5
File Type.mq5 Source
StrategyBreakout
Risk LevelMedium Risk
Timeframes
M1
Currency Pairs
EURUSDUSDJPYGBPUSDAUDUSD
Min. Deposit$100