P
PipsGrowth
BreakoutOpen Source – Free

Pipsgrowth EX02002 Breakout

MT5 Expert Advisor (Open Source) · XAUUSD · M5

Pipsgrowth.com EX02002 WINDOWS V2 — Session-window breakout (HH/LL of intraday window + HTF trend + regime gate).

Overview

Pipsgrowth EX02002 is a session-window consolidation breakout built around the idea that an early-session range resolves into a directional move once the real liquidity arrives. The header in the .mq5 spells it out: "Define an intraday window of N hours; HH/LL inside form a range. Enter on close outside range in HTF trend direction with regime gate + confirm stack." The default window is 3 hours (InpWindowHours=3), so the EA scans the last 36 M5 bars (3h × 12 bars/h) for the highest high and the lowest low, draws a horizontal band around that range, and waits for a closed M5 bar to print its close above the upper edge or below the lower edge. A 20-point buffer (InpBreakoutBufferPts) sits just outside the band to keep marginal touches from triggering fakeouts. The trade then has to clear a higher-timeframe EMA(50) test on H1 to confirm direction: a long breakout is only valid if the H1 close sits above its 50-EMA, and a short breakout is only valid below it. This is what makes EX02002 a 'range resolution' style EA rather than a momentum-chase breakout — the price has been coiling, the band has formed, and the close-outside-range is the release.

The signal is generated by WindowBreakoutSignal(), which runs on the last CLOSED M5 bar (shift = 1, never the forming bar). It first checks whether the bar's hour is within the session-window-eligible window (barHour ≥ SESSION_END_HOUR = 10 and barHour < SESSION_END_HOUR + 6, i.e. server-time 10:00–15:59). If yes, it scans InpWindowHours × 12 = 36 bars back for HH/LL; if no, it falls back to a longer WINDOW_LOOKBACK_BARS = 72-bar scan, which gives a usable range even before the optimal hour. The function also computes a confidence score that scales linearly with how far the close has travelled past the buffer: 50 base points plus 0.5 per point of penetration, capped at 100. Trades only proceed if confidence ≥ MIN_CONFIDENCE = 55. A duplicate-entry guard ensures that EX02002 fires at most once per closed M5 bar, so a clean close above the range cannot trigger both a long entry and a same-bar reverse short.

Behind the signal sits a 7-state regime classifier (ClassifyRegime()) that runs every tick. The classifier uses ATR(14), a long ATR (100-bar lookback), ADX(14), and Bollinger Bands (20, 2.0). The thresholds are: ADX ≥ 30 with ATR percentile ≥ 60 → StrongTrend; ADX ≥ InpAdxTrendMin (22) with ATR percentile ≥ 40 → WeakTrend; Bollinger width compressed below 0.60× the historical 100-bar width → Compress; width above 1.50× historical → Expand; ATR percentile ≥ 65 with ADX < 22 → Breakout; ATR percentile < 25 with ADX < 18 → Range. Anything ambiguous falls into Choppy. The NoTradeReason() layer then hard-blocks entries whenever regime is Choppy or Range — the two states where a clean range-resolution signal is least likely to actually resolve. This is the same principle that drives the Compress and Choppy blocks in EX02001's regime layer, but with different state names and a different mix of indicators (BB width + ATR percentile, not the same percentile + BB ratio).

The confirmation stack (ConfirmStack()) adds three extra gates on top of the regime filter. (1) HTF EMA(50) agreement: with InpRequireHTFConfirm = true, a buy needs the H1 close above the 50-EMA and a sell needs it below. (2) Volatility floor: the closed M5 bar's range must be at least InpMinVolatilityPts = 30 points; otherwise the breakout is flagged as 'volatility too low' and rejected. (3) Spread gate: live spread must be below min(InpMaxSpreadPts = 35, rolling-60-bar-spread-average × 1.8). The rolling-60-bar average keeps the spread cap adaptive — in tight markets the cap tightens with the market, in volatile markets it relaxes but never above the absolute 35-point ceiling. The function also enforces a server-time session window (between SESSION_START_HOUR = 7 and SESSION_END_HOUR + 6 = 16) so that entries do not fire during off-hours.

Risk management lives in a single TryEntry() path. The stop loss is set at 1.6× ATR(14) of the closed bar (ATR_SL_MULT = 1.6) and the take profit is 2.5× ATR (TP_R = 2.5), giving a 1:1.56 raw risk-reward. The code then enforces a structural minimum of CONF_MIN_RR = 1.8 — if the structural R/R drops below that, the trade is rejected. The lot is sized by ComputeLotFromRisk(): risk in USD = effective capital × InpRiskPercent (0.5%) / 100, divided by the per-lot loss at the configured stop. Lots are clamped to broker min/max/step, capped at InpMaxLot = 100, and floored to the broker minimum. If sizing fails, InpFixedLotFallback = 0.01 is used. Before the order is sent, OrderCalcMargin verifies that the trade's margin is below the free margin, and a portfolio-heat check sums the dollar risk of every open position under this magic and rejects the trade if the sum exceeds 6% of effective capital (InpMaxPortfolioHeatPct). A 3-attempt retry loop with 100ms back-off handles requotes and price changes; on success the magic is stamped and the entry time logged.

In-trade management runs on every tick via ManagePositions(). After the close reaches +1.0R, the stop is moved to break-even (entry price); the ClampToStopsLevel() helper ensures the new stop respects the broker's minimum stop distance. After +1.2R, 50% of the position is closed as a partial TP (only if remaining volume ≥ 2× the broker minimum lot). Then a 2.5× ATR(14) trailing stop ratchets the stop on every tick — a 2.5 ATR buffer that only tightens, never widens, so the trade has room to breathe. The exit logic (ExitLogic()) closes the position on three additional triggers: an opposite-direction signal from WindowBreakoutSignal(), a regime change to Choppy (regardless of profit), or a time exit when BarsSinceOpen > MAX_BARS_IN_TRADE = 240 (roughly 20 hours on M5).

The hardening layer adds a substantial safety stack. IsSafeToTrade_EX02002() rejects new entries when equity falls below the InpCapitalCapFloor = 50, when equity drops below InpMinEquityPercent = 80% of the initial balance, when the daily trade count exceeds InpMaxTradesPerDay = 50, when 3 consecutive losses have triggered a 4-hour cooldown (MAX_CONSEC_LOSSES_COOLDOWN), when the market is closed (Friday ≥ 21 GMT, Sunday < 22 GMT, full Saturday), when the GMT session check fails (InActiveSession_EX02002 returns false outside London 7–16 and New York 12–21, and InpAvoidAsia = true blocks pure Asia hours 0–7), or when the total drawdown exceeds InpMaxDDPct = 20% (the kill switch). OnTradeTransaction() watches the deal stream, increments the consecutive-loss counter on any negative DEAL_ENTRY_OUT for this magic, and resets it to 0 on the next win. The InpDryRun = true default means the EA prints a [DRY-RUN ENTRY] log line and skips the actual CTrade.Buy/CTrade.Sell call until the user explicitly toggles live trading — this is a meaningful safety net for a robot that can hold positions overnight.

The OnTester pass/fail criterion is conservative: it returns 0 unless the backtest has at least 30 trades, net profit > 0, and drawdown ≤ InpMaxDDPct (20% default). When those gates pass, the score is (net × profit factor) / (1 + equity drawdown in account currency), rewarding profitable runs with low DD.

In backtest, EX02002 is expected to take relatively few trades — the regime filter, the volatility floor, the HTF EMA confirm, the spread gate, and the 1-trade-per-closed-bar guard all stack up. On M5 XAUUSD with default inputs, a typical good period produces one trade every few days during active London/NY hours. The 1.6 ATR stop with a 2.5 ATR target means most trades that survive the early break-even test tend to close at a partial TP and then at the trailing stop in the same direction. The single-concurrent-trade cap (InpMaxConcurrentTrades = 1) makes this a swing-style breakout rather than a pyramider — the same EA name in the family has higher cap in other variants.

Strategy Deep Dive

EX02002 reads the highest high and lowest low of a rolling 3-hour M5 window (configurable via InpWindowHours) and treats that band as a consolidation range; an entry fires when the next closed M5 bar breaks outside the band by InpBreakoutBufferPts = 20 points, with a confidence score that scales with the breakout distance. The 7-state regime classifier (StrongTrend / WeakTrend / Range / Breakout / Compress / Expand / Choppy) — built from ATR(14) percentile, ADX(14), and Bollinger Band(20, 2.0) width ratio — hard-blocks entries whenever the market is Range or Choppy, so the EA only fires when the range has a real chance of resolving directionally. The confirm stack then enforces H1 EMA(50) trend agreement, a 30-point volatility floor on the closed bar, and an adaptive spread cap of min(35 pts, 1.8× the 60-bar rolling average). The lot is sized at 0.5% of effective capital per trade, with a 1.6 ATR stop and a 2.5 ATR target (rejected if structural R/R < 1.8), a break-even at +1R, a 50% partial TP at +1.2R, a 2.5 ATR trailing stop, and a 240-bar time exit. Safety stack: capital floor $50, min equity 80% of initial balance, daily loss 3%, weekly loss 9%, 3 consecutive losses → 4-hour cooldown, max DD 20% kill switch, 1 concurrent trade cap, 50 trades/day cap, London/NY session filter, Asia avoidance, GMT auto-detection, dry-run default ON.

Entry Signal

EX02002 enters long when the last CLOSED M5 bar prints its close above the highest high of the prior 3-hour (36-bar) session window plus a 20-point buffer, and short on the mirror close below the window low minus the buffer. The signal must clear a 7-state regime filter (Choppy and Range are blocked), a structural confidence ≥ 55 (50 + 0.5× penetration in points), a H1 EMA(50) agreement test (price on the correct side of the 50-EMA), a 30-point bar-range volatility floor, and a spread cap of min(35 pts, 1.8× the 60-bar rolling average). One entry per closed M5 bar, with a 120-second cooldown after any entry.

Exit Signal

EX02002 runs a layered exit stack: the stop is moved to break-even (entry price) once the trade is up +1R, 50% is closed at +1.2R, and a 2.5× ATR(14) trailing stop ratchets the stop on every tick after that. Additional exit triggers are an opposite-direction WindowBreakoutSignal, a regime change to Choppy (regardless of profit), and a time exit at MAX_BARS_IN_TRADE = 240 (about 20 hours on M5).

Stop Loss

Initial stop loss is set at entry ± 1.6 × ATR(14) of the closed M5 bar (ATR_SL_MULT = 1.6), then moved to break-even (entry price) once the trade reaches +1R, and from that point a 2.5× ATR(14) trailing stop ratchets on every tick. The ClampToStopsLevel helper ensures every SL level respects the broker's minimum stop distance.

Take Profit

Initial take-profit is set at entry ± 2.5 × ATR(14) (TP_R = 2.5), and the code rejects the trade if the resulting structural R/R is below CONF_MIN_RR = 1.8. In practice, EX02002 closes most winners in two stages: 50% at +1.2R via partial TP, then the remainder at the 2.5× ATR trailing stop, an opposite signal, a Choppy regime flip, or the 240-bar time exit.

Best For

Best for XAUUSD traders running M5 with a low-spread ECN or RAW broker (the 35-point spread cap is tight enough that retail-markup accounts will get filtered out). Minimum recommended balance $100 (the capital floor is $50, but 0.5% risk on a $100 account leaves little room for the 1.6 ATR stop), with default inputs configured for XAUUSD's typical point size. Session timing is the London-NY overlap window (London 7–16 GMT, NY 12–21 GMT, Asia 0–7 GMT blocked by InpAvoidAsia) — Asian session breakouts are explicitly not a target. Suitable for MEDIUM-risk prop-firm rules (3% daily / 9% weekly / 20% DD kill), but the 1-concurrent-trade cap and the high selectivity of the regime + HTF + volatility + spread gate mean the EA produces relatively few trades, so traders expecting high trade counts should look elsewhere.

Strategy Logic

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

Family: Breakout Magic: 22202002 Version: 2.00

BRIEF: Session-window consolidation breakout. Define an intraday window of N hours; HH/LL inside form a range. Enter on close outside range in HTF trend direction with regime gate + confirm stack. ATR SL, layered TP/BE/trail, capital cap. 12 layers

INDICATOR STACK:

  • ATR
  • ATRlong
  • ADX
  • BB
  • EmaHTF
  • EmaSignal

KEY FUNCTIONS:

  • EffectiveCapital()
  • MagicRealizedPnL()
  • ComputeLotFromRisk()
  • ClampToStopsLevel()
  • SpreadAvg()
  • PushSpread()
  • ClassifyRegime()
  • WindowBreakoutSignal()
  • ConfirmStack()
  • NoTradeReason()
  • TryEntry()
  • ManagePositions()
  • ...and 12 more

INTERNAL CONSTANTS (10 total):

  • HTF_TREND_PERIOD = 50 // EMA period on HTF
  • WINDOW_LOOKBACK_BARS = 72 // bars to search for window HH/LL if no intraday window yet
  • VOL_ATR_MULT = 1.10 // volatility filter: ATR must exceed this * long-term ATR
  • CONF_MIN_RR = 1.8 // minimum reward:risk
  • BREAK_EVEN_R = 1.0 // move SL to entry at +1R
  • PARTIAL_TP_R = 1.2 // close 50% at +1.2R
  • MAX_BARS_IN_TRADE = 240 // ~20h on M5
  • SESSION_START_HOUR = 7 // server-time window-start hour
  • SESSION_END_HOUR = 10 // server-time window-end hour (breakout eligible after this)
  • MAX_CONSEC_LOSSES_COOLDOWN = 3 // ============================ INPUTS ==============================

INPUT PARAMETERS (36 total across 8 groups):

  • [=== Identity ===] InpMagicNumber = 22202002 // Magic number (unique per EA)
  • [=== Identity ===] InpTradeComment = "Psgrowth.com Expert_02002" // Trade comment
  • [=== Identity ===] InpKillSwitch = false // Kill switch (hard halt)
  • [=== Identity ===] InpDryRun = true // Dry-run (no live orders)
  • [=== Risk & Sizing ===] InpRiskPercent = 0.5 // Risk per trade, % of effective capital
  • [=== Risk & Sizing ===] InpDailyLossLimitPct = 3.0 // Daily loss limit, % of effective capital
  • [=== Risk & Sizing ===] InpWeeklyLossLimitPct = 9.0 // Weekly loss limit, % of effective capital
  • [=== Risk & Sizing ===] InpMaxConcurrentTrades = 1 // Max concurrent trades (this EA/magic)
  • [=== Risk & Sizing ===] InpFixedLotFallback = 0.01 // Fallback fixed lot if sizing fails
  • [=== Risk & Sizing ===] InpMaxPortfolioHeatPct = 6.0 // Max portfolio heat (sum risk %), cap
  • [=== Capital Allocation Cap ===] InpCapitalCapAmount = 0.0 // Capital cap amount (0=disabled, USD equity)
  • [=== Capital Allocation Cap ===] InpCapitalCapFloor = 50.0 // Floor below which new entries are blocked
  • [=== Signal (Windows Breakout) ===] InpWindowHours = 3 // Window length, hours (Asia-style range)
  • [=== Signal (Windows Breakout) ===] InpBreakoutBufferPts = 20 // Buffer beyond window HH/LL, in points
  • [=== Signal (Windows Breakout) ===] InpMinVolatilityPts = 30 // Min bar range, points (vol filter)
  • [=== Regime / Confirm ===] InpAdxTrendMin = 22.0 // ADX ≥ → trend
  • [=== Regime / Confirm ===] InpMaxSpreadPts = 35 // Max allowed spread, points
  • [=== Regime / Confirm ===] InpRequireHTFConfirm = true // Require HTF EMA agreement
  • [=== Exit / Manage ===] InpTradeCooldownSec = 120 // Cooldown between entries, seconds
  • [=== Exit / Manage ===] InpEnableBreakEven = true // Move SL to break-even at +1R
  • [=== Exit / Manage ===] InpEnablePartialTP = true // Take 50% off at +1.2R
  • [=== Hardening: GMT Sessions & Safety ===] InpServerGMTOffset = 0 // Server GMT offset (0=auto-detect)
  • [=== Hardening: GMT Sessions & Safety ===] InpLondonStartHour = 7 // London session start (GMT)
  • [=== Hardening: GMT Sessions & Safety ===] InpLondonEndHour = 16 // London session end (GMT)
  • [=== Hardening: GMT Sessions & Safety ===] InpNYStartHour = 12 // NY session start (GMT)
  • [=== Hardening: GMT Sessions & Safety ===] InpNYEndHour = 21 // NY session end (GMT)
  • [=== Hardening: GMT Sessions & Safety ===] InpAvoidAsia = true // Avoid Asian session
  • [=== Hardening: GMT Sessions & Safety ===] InpAsiaStartHour = 0 // Asia session start (GMT)
  • [=== Hardening: GMT Sessions & Safety ===] InpAsiaEndHour = 7 // Asia session end (GMT)
  • [=== Hardening: GMT Sessions & Safety ===] InpNewsFilter = false // Enable news time filter
  • [=== Hardening: GMT Sessions & Safety ===] InpNewsFilterMinutes = 15 // News blackout minutes around session opens
  • [=== Hardening: GMT Sessions & Safety ===] InpMaxTradesPerDay = 50 // Max total trades per day
  • [=== Hardening: GMT Sessions & Safety ===] InpMinEquityPercent = 80.0 // Min equity as % of initial balance
  • [=== Hardening: GMT Sessions & Safety ===] InpMaxConsecLosses = 3 // Max consecutive losses before cooldown
  • [=== Safety Caps ===] InpMaxDDPct = 20.0 // Max total drawdown % (0=disabled, triggers kill switch)
  • [=== Safety Caps ===] InpMaxLot = 100.0 // Maximum lot size cap
Pseudocode
// Pipsgrowth EX02002 Breakout — Execution Flow (from source analysis)
// Family: Breakout
// Session-window consolidation breakout. Define an intraday window of N hours; HH/LL inside form a range. Enter on close outside range in HTF trend direction with regime gate + confirm stack. ATR SL, layered TP/BE/trail, capital cap. 12 layers

ON_INIT:
    Create indicator handles: ATR, ATRlong, ADX, BB, EmaHTF, EmaSignal
    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:
M5

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
InpMagicNumber22202002Magic number (unique per EA)
InpTradeComment"Psgrowth.com Expert_02002"Trade comment
InpKillSwitchfalseKill switch (hard halt)
InpDryRuntrueDry-run (no live orders)
InpRiskPercent0.5Risk per trade, % of effective capital
InpDailyLossLimitPct3.0Daily loss limit, % of effective capital
InpWeeklyLossLimitPct9.0Weekly loss limit, % of effective capital
InpMaxConcurrentTrades1Max concurrent trades (this EA/magic)
InpFixedLotFallback0.01Fallback fixed lot if sizing fails
InpMaxPortfolioHeatPct6.0Max portfolio heat (sum risk %), cap
InpCapitalCapAmount0.0Capital cap amount (0=disabled, USD equity)
InpCapitalCapFloor50.0Floor below which new entries are blocked
InpWindowHours3Window length, hours (Asia-style range)
InpBreakoutBufferPts20Buffer beyond window HH/LL, in points
InpMinVolatilityPts30Min bar range, points (vol filter)
InpAdxTrendMin22.0ADX ≥ → trend
InpMaxSpreadPts35Max allowed spread, points
InpRequireHTFConfirmtrueRequire HTF EMA agreement
InpTradeCooldownSec120Cooldown between entries, seconds
InpEnableBreakEventrueMove SL to break-even at +1R
InpEnablePartialTPtrueTake 50% off at +1.2R
InpServerGMTOffset0Server GMT offset (0=auto-detect)
InpLondonStartHour7London session start (GMT)
InpLondonEndHour16London session end (GMT)
InpNYStartHour12NY session start (GMT)
InpNYEndHour21NY session end (GMT)
InpAvoidAsiatrueAvoid Asian session
InpAsiaStartHour0Asia session start (GMT)
InpAsiaEndHour7Asia session end (GMT)
InpNewsFilterfalseEnable news time filter
InpNewsFilterMinutes15News blackout minutes around session opens
InpMaxTradesPerDay50Max total trades per day
InpMinEquityPercent80.0Min equity as % of initial balance
InpMaxConsecLosses3Max consecutive losses before cooldown
InpMaxDDPct20.0Max total drawdown % (0=disabled, triggers kill switch)
InpMaxLot100.0Maximum lot size cap
Source Code (.mq5)Open Source
Pipsgrowth_com_EX02002.mq5
#property copyright "Pipsgrowth.com"
#property link      "https://pipsgrowth.com"
#property version   "2.00"
#property strict
#property description "Pipsgrowth.com EX02002 WINDOWS V2 — Session-window breakout (HH/LL of intraday window + HTF trend + regime gate)."

//============================ INCLUDES =============================
#include <Trade\Trade.mqh>
#include <Trade\PositionInfo.mqh>
#include <Trade\SymbolInfo.mqh>
#include <Trade\AccountInfo.mqh>
#include <Trade\OrderInfo.mqh>
#include <Trade\DealInfo.mqh>

//============================ TUNABLES (constants, NOT inputs) ====
#define ATR_REGIME_PERIOD        14
#define ATR_PCTILE_LOOKBACK      100
#define BB_REGIME_PERIOD         20
#define BB_REGIME_DEV            2.0
#define ADX_REGIME_PERIOD        14
#define HTF_TREND_PERIOD         50      // EMA period on HTF
#define HTF_TIMEFRAME            PERIOD_H1
#define SIGNAL_TIMEFRAME         PERIOD_M5
#define WINDOW_LOOKBACK_BARS     72      // bars to search for window HH/LL if no intraday window yet
#define VOL_ATR_MULT             1.10    // volatility filter: ATR must exceed this * long-term ATR
#define CONF_MIN_RR              1.8     // minimum reward:risk
#define BREAK_EVEN_R             1.0     // move SL to entry at +1R
#define PARTIAL_TP_R             1.2     // close 50% at +1.2R
#define PARTIAL_TP_FRAC          0.50
#define TRAIL_ATR_MULT           2.5
#define MAX_BARS_IN_TRADE        240     // ~20h on M5
#define ATR_SL_MULT              1.6
#define TP_R                     2.5
#define SPREAD_ROLLING_BARS      60
#define SESSION_START_HOUR       7       // server-time window-start hour
#define SESSION_END_HOUR         10      // server-time window-end hour (breakout eligible after this)
#define SLOPE_BARS               3
#define MIN_CONFIDENCE           55
#define MAX_CONSEC_LOSSES_COOLDOWN 3

//============================ INPUTS ==============================
//--- Identity
input group "=== Identity ==="
input long   InpMagicNumber         = 22202002;                     // Magic number (unique per EA)
input string InpTradeComment        = "Psgrowth.com Expert_02002";  // Trade comment
input bool   InpKillSwitch          = false;                       // Kill switch (hard halt)
input bool   InpDryRun              = true;                        // Dry-run (no live orders)

//--- Risk & Sizing
input group "=== Risk & Sizing ==="
input double InpRiskPercent         = 0.5;                         // Risk per trade, % of effective capital
input double InpDailyLossLimitPct   = 3.0;                         // Daily loss limit, % of effective capital
input double InpWeeklyLossLimitPct  = 9.0;                         // Weekly loss limit, % of effective capital
input int    InpMaxConcurrentTrades = 1;                           // Max concurrent trades (this EA/magic)
input double InpFixedLotFallback    = 0.01;                        // Fallback fixed lot if sizing fails
input double InpMaxPortfolioHeatPct = 6.0;                         // Max portfolio heat (sum risk %), cap

//--- Capital Allocation Cap (§4.6 mandatory)
input group "=== Capital Allocation Cap ==="
// InpCapitalCapEnabled removed — use InpCapitalCapAmount=0 to disable

Full source code available on download

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

Tags:ex02002breakoutpipsgrowthfreemt5xauusd

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_EX02002.mq5
File Size38.7 KB
Versionv2.00
PlatformMetaTrader 5
File Type.mq5 Source
StrategyBreakout
Risk LevelMedium Risk
Timeframes
M5
Currency Pairs
XAUUSD
Min. Deposit$100