Pipsgrowth EX02033 Breakout
MT5 Expert Advisor (Open Source) · XAUUSD · M5
Pipsgrowth.com EX02033 U4 — Scalping breakout with EMA ribbon, Gaussian slope, volume/ATR spikes, full 12-layer stack.
Overview
EX02033 is a score-based breakout scalper designed for XAUUSD on the M5 timeframe. Instead of looking for one signal pattern, the EA scores every new tick against twelve independent confirmations and only opens a position when the total score crosses a configurable threshold (MinimumSignalScore, default 7 of 12). Every confirmation is toggleable, so the same EA can run as a strict 9-of-12 confirmer or a permissive 5-of-12 sweeper without changing code, and each filter logs its individual pass/fail to the terminal so you can audit which votes fired on any given bar.
The twelve confirmations evaluate, in order: a three-EMA ribbon on the working timeframe (EMAPeriod1/2/3 default 8/13/21, requiring EMA1 > EMA2 > EMA3 with the close above EMA1 for longs, mirror for shorts); a Gaussian slope filter built on a period-20 EMA (slope must exceed GaussianMinSlope=0.0001 in the trade direction); a volume spike (current tick volume > VolumeSpikeMultiplier=1.8 multiplied by the 20-bar average); an ATR spike (current ATR(14) > ATRSpikeMultiplier=1.5 multiplied by the 20-bar average); a Bollinger Band squeeze release (current BB(20, 2.0) width greater than any of the last LookBackSqueezeBars=10 bars); a same-timeframe M5 EMA fast/slow cross using periods 8 and 21; a higher-timeframe M15 EMA fast/slow cross on the same 8/21 pair that acts as a regime gate; an approximated Heiken Ashi candle pattern (close above open with the low at the candle floor for longs); an optional trap-wick filter (disabled by default, but when EnableTrapWick is on it looks for wicks piercing the prior bar by TrapWickPipThreshold=20 pips); a spread cap of MaxSpread=20 points; the CooldownSeconds=30 second post-trade pause; and a stacking gate that permits a re-entry only when the existing direction is already floating more than MinFloatingProfitPipsToAdd=10 pips in profit.
Once the score crosses the threshold, ExecuteBuy or ExecuteSell runs. Both routines compute the stop and target as ATR(14) multiplied by ATRSpikeMultiplier on the bid/ask at execution, then submit a market order through the CTrade wrapper with three retry attempts on REQUOTE / TIMEOUT / PRICE_OFF / PRICE_CHANGED at 200 millisecond intervals. A pre-order OrderCalcMargin check guards against margin rejection. FixedLot (default 0.10) is used unless UseEquityRisk is on, in which case the lot scales to RiskPercent of free margin. Magic 22202033 is stamped on every order, which lets this EA coexist on the same account with other PipsGrowth EAs without position-counting collisions.
Position management runs in ManageOpenTrades on every tick and is asymmetric. When a position is more than 20 pips in profit AND the current stop is still within 5 points of entry, the EA ratchets the stop to price plus 10 points for longs (price minus 10 for shorts), effectively locking in a small breakeven-plus buffer that respects LockBufferPips=5. On every other tick, the EA trails the stop to bid minus 0.5 multiplied by ATR for longs and ask plus 0.5 multiplied by ATR for shorts, only ever tightening, never loosening. The pips-based TP1=30 and TP2=60 inputs are defined in the Exit & Risk Management group, but the target that actually ships with the order is the ATR-derived distance, not a fixed pips target, so the run-time risk on entry is roughly 1:1 against the initial stop. MaxOpenTradesPerDirection=3 combined with MinFloatingProfitPipsToAdd=10 produces the stacking behaviour: you can be in up to three longs (or three shorts) at once, but only if the existing ones are already floating green, which kills the classic add-into-a-loser pattern that ruins most breakout systems.
The EA carries a full safety stack layered on top of the signal logic. UpdateDailyCounters_EX02033 rotates g_tradesToday, g_realizedToday, and g_consecLosses at the day boundary, and resets g_realizedWeek at the week boundary. IsSafeToTrade_EX02033 chains IsMarketOpen_EX02033 (blocks Sunday, Saturday, Monday before 22:00 GMT, and Friday from 22:00 GMT), InActiveSession_EX02033 (London 7-16 GMT union New York 12-21 GMT, only enforced when InpUseGMTSessions=true; the default false leaves session gating to the broker-time IsTradingTime check that uses SessionStartHour=9 and SessionEndHour=22), IsNewsTime_EX02033 (a CalendarValueHistory lookup plus or minus InpNewsBufferMinutes=30 minutes for CALENDAR_IMPORTANCE_HIGH events when InpFilterNews=true), an optional capital cap (MathMin(InpCapAmount, equity) must stay above InpCapFloor=1000), an equity floor (g_initialBalance multiplied by InpMinEquityPct divided by 100, defaulting to 70%), a daily loss brake (the absolute value of g_realizedToday must stay below 5% of initial balance), a max-trades-per-day cap of 20, and a consecutive-loss cooldown where g_consecLosses reaching InpMaxConsecLosses=5 triggers a 4-hour shutdown. ExceededDrawdown watches equity-drawdown in real time and trips at MaxDrawdownPercent=25, while IsFridayCloseNear forces CloseAllTrades at FridayCloseHour:FridayCloseMinute=21:59 by default.
Inputs are organised in nine groups: Identity, Entry Logic Filters, EMA Ribbon, Gaussian Filter, Volume and Volatility Filters, Multi-Timeframe Confirmation, Exit and Risk Management, Time-Based Controls, and the Hardening stack of GMT Session Filter, Capital Protection, and Trade Safety. OnInit validates that all hardening inputs are within sane ranges (positive magic, positive FixedLot, InpMaxTradesPerDay above 1, InpMinEquityPct between 0 and 100, InpCapFloor strictly less than InpCapAmount when the cap is enabled) and returns INIT_PARAMETERS_INCORRECT with a localised Print if any are out of bounds. DetectGMTOffset_EX02033 runs the best-of -12..+12 hour heuristic on server time, weighting weekdays and 7-21 GMT hours, so the London and New York windows line up with the broker's clock without manual configuration. g_initialBalance is captured at OnInit, g_gmtOffset is auto-detected once and logged, and indicator handles for the EMA ribbon, Gaussian, ATR, Bollinger Bands, M5 EMA pair, and M15 EMA pair are all created up front and reused for the life of the EA.
What to expect in a backtest: the score gate keeps trade frequency moderate, so the MetaTrader tester will produce somewhere in the range of 50-200 trades over a five-year XAUUSD M5 sample, depending on how strict you set MinimumSignalScore. The OnTester custom criterion is profit multiplied by profitFactor divided by maxDD, gated on at least 10 trades with profit factor clamped to 1-1000 and max drawdown floored at 1, which favours stable profit factors over headline net profit and tends to pick parameter sets where the equity curve is smooth rather than spiky. Because the trailing logic is asymmetric — ratchet to plus 10 points at plus 20 pips, then trail at 0.5 multiplied by ATR — expect a higher win rate on the trailing leg and a small number of larger losses from the 1:1 ATR-distance stop on initial entries. The EA defaults to MEDIUM risk on the listing because FixedLot=0.10 keeps a typical 0.01-lot-per-pip XAUUSD account well under control, but raising the lot or turning on UseEquityRisk with RiskPercent=1.0 quickly escalates risk to HIGH. Run it on a low-spread ECN or RAW account on XAUUSD; the MaxSpread=20 points filter is tight enough that wider retail quotes will silently block entries on quiet sessions and leave the EA idle for stretches of the day.
Strategy Deep Dive
Every tick, the EA runs ScoreFilters on both directions and logs the per-filter pass/fail to the terminal; a buy or sell only fires when its score crosses MinimumSignalScore=7, which is the gate that turns a noisy breakout into a confirmed one. ManageOpenTrades then walks every open position, applying the lock-at-20-pips or 0.5x ATR trail rule, and TryModify_EX02033 retries the modification three times at 200 ms on transient rejections. The hardening chain in IsSafeToTrade_EX02033 blocks the EA during weekend gaps, optional London / New York GMT sessions, plus or minus 30 minutes of high-impact news, an equity floor at 70% of initial balance, a 5% daily loss, and a 4-hour cooldown after five consecutive losses; ExceededDrawdown kills the EA at 25% drawdown. OnInit validates all hardening inputs and returns INIT_PARAMETERS_INCORRECT on out-of-bounds values, and DetectGMTOffset_EX02033 auto-calibrates the GMT offset from server time so the London / New York window lines up without manual configuration.
A long entry fires when the twelve independent filters score at least 7 points, requiring the EMA ribbon (8/13/21) to be fully stacked with close above EMA1, the Gaussian(20) slope to be rising above 0.0001, tick volume to exceed 1.8x its 20-bar average, ATR(14) to exceed 1.5x its 20-bar average, and the M5 plus M15 EMA 8/21 crosses to align. The BB squeeze release, approximated Heiken Ashi candle pattern, spread cap, and 30-second post-trade cooldown contribute the remaining score, and re-entry stacking is allowed only when the existing direction is already floating more than 10 pips in profit.
Exits are managed tick-by-tick: positions more than 20 pips in profit with the stop still within 5 points of entry get the stop ratcheted to entry plus 10 points (lock), and on every other tick the stop trails to bid minus 0.5x ATR for longs and ask plus 0.5x ATR for shorts, only ever tightening. Additional exits include EnableExitOnTrendFlip, an optional timed exit at MaxTradeDurationMinutes=60, a Friday 21:59 close-all, and a 25% equity-drawdown kill switch.
On entry, SL is bid minus ATRSpikeMultiplier(1.5) multiplied by ATR(14) for longs and ask plus 1.5 multiplied by ATR(14) for shorts, giving roughly 1:1 against the submitted TP. After entry, the stop ratchets to entry plus 10 points at plus 20 pips of profit and then trails at 0.5x ATR; the global MaxDrawdownPercent=25 acts as an account-level kill.
TP submitted with the order is ask plus 1.5 multiplied by ATR(14) for longs and bid minus 1.5 multiplied by ATR(14) for shorts, giving roughly 1:1 reward-to-risk on entry. The pips-based TP1=30 and TP2=60 inputs are defined in the input list but the actual exit comes from the lock-plus-trail logic, not a fixed pips target.
Minimum recommended balance is $100 on XAUUSD M5 with a low-spread ECN or RAW broker; MaxSpread=20 points will silently block entries above 20 points, so wider retail accounts will see fewer trades. Best deployed during the London and New York session overlap (the IsTradingTime window is 09:00-22:00 server time by default, with optional GMT filtering to London 7-16 / NY 12-21). MEDIUM risk classification reflects the FixedLot=0.10 default and roughly 1:1 ATR(14) by 1.5 risk-reward on entry; raise the lot, switch to UseEquityRisk with RiskPercent=1.0, or relax the score threshold below 7 to escalate. Run the EA on XAUUSD only, since the M5 / M15 multi-timeframe confirmation stack is calibrated for gold volatility.
Strategy Logic
Pipsgrowth EX02033 Breakout — Strategy Logic Analysis (from .mq5 source)
Family: Breakout
Magic: 22202033
Version: 2.00
BRIEF:
Scalping breakout EA using EMA ribbon, Gaussian slope, volume/ATR spikes, Bollinger Band squeeze and multi-timeframe confirmation with Heiken Ashi. Score-based entry with stacking. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
GetBid()GetAsk()ScoreFilters()LogFilterResults()ExecuteBuy()ExecuteSell()ManageOpenTrades()CountOpenPositions()GetTotalFloatingProfit()IsTradingTime()ExceededDrawdown()IsFridayCloseNear()- ...and 11 more
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (5 total across 4 groups):
- [=== Time-Based Controls ===]
MinSecondsBetweenTrades= 10 // --- Hardening:GMTSession Filter --- - [===
GMTSessionFilter(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 // --- Hardening Globals
// Pipsgrowth EX02033 Breakout — Execution Flow (from source analysis)
// Family: Breakout
// Scalping breakout EA using EMA ribbon, Gaussian slope, volume/ATR spikes, Bollinger Band squeeze and multi-timeframe confirmation with Heiken Ashi. Score-based entry with stacking. 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 an H1 or H4 chart
- 7Set the range detection period, breakout buffer, and lot size in the EA dialog
- 8Enable Allow Algo Trading and click OK
EA Parameters
| Parameter | Default | Description |
|---|---|---|
| MinSecondsBetweenTrades | 10 | --- Hardening: GMT Session Filter --- |
| InpNewYorkEndGMT | 21 | --- Hardening: Capital Protection --- |
| InpCapAmount | 0.0 | Capital cap amount (0=disabled) |
| InpDailyLossLimitPct | 5.0 | --- Hardening: Trade Safety --- |
| InpNewsBufferMinutes | 30 | --- Hardening Globals |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX02033 U4 — Scalping breakout with EMA ribbon, Gaussian slope, volume/ATR spikes, full 12-layer stack."
#include <Trade/Trade.mqh>
CTrade trade;
// === INPUTS: GROUPED & DOCUMENTED ===
enum ExitMode { ATR_SL, HA_SL };
struct FilterResult
{
string name;
bool passed;
double value;
};
input group "=== Identity ==="
input bool EnableBuy = true;
input bool EnableSell = true;
input int MagicNumber = 22202033;
input string InpTradeComment = "Psgrowth.com Expert_02033";
input double FixedLot = 0.1;
input bool UseEquityRisk = false;
input double RiskPercent = 1.0;
input int MaxSpread = 20;
input int CooldownSeconds = 30;
input int MaxOpenTradesPerDirection = 3;
input double MinFloatingProfitPipsToAdd = 10;
input int MinimumSignalScore = 7;
input bool AllowAdditionalTradesWithoutFilter= false;
input int MaxDrawdownPercent = 25;
input string TradeLabelPrefix = "XAU_AI_PRO_";
input group "=== Entry Logic Filters ==="
input bool EnableTrapWick = false;
input double TrapWickPipThreshold = 20;
input bool RequireHeikenAshi = true;
input bool RequireGaussianSlope = true;
input bool RequireEMARibbon = true;
input group "=== EMA Ribbon ==="
input int EMAPeriod1 = 8;
input int EMAPeriod2 = 13;
input int EMAPeriod3 = 21;
input group "=== Gaussian Filter ==="
input bool EnableGaussianSlopeFilter = true;
input int GaussianPeriod = 20;
input double GaussianMultiplier = 1.5;
input double GaussianMinSlope = 0.0001;
input group "=== Volume & Volatility Filters ==="
input bool EnableVolumeSpikeFilter = true;
input int VolumeWindowSize = 20;
input double VolumeSpikeMultiplier = 1.8;
input bool EnableATRSpikeFilter = true;
input int ATRPeriod = 14;
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 Breakout strategy EAs from our library
Pipsgrowth EX02026 Breakout
Pipsgrowth.com EX02026 XAUUSD_M5_Donchian_EA — Donchian breakout with RSI and speed filter, full 12-layer stack.
Pipsgrowth EX02001 Breakout
Pipsgrowth.com EX02001 HFS NS92 XAUUSD 5M — fractal Donchian breakout with RSI extreme filter, full 12-layer stack.
Pipsgrowth EX02027 Breakout
Pipsgrowth.com EX02027 EX8 Multi-Symbol VWAP+KAMA Donchian — multi-symbol scalper with ADX regime switch, full 12-layer stack.
Community
Educational purposes only. Do NOT use with real money. Test on demo accounts only.