Pipsgrowth EX14003 Scalper
MT5 Expert Advisor (Open Source) · XAUUSD · H1
Pipsgrowth.com EX14003 od10leporadi — timing-based multi-TF scalper, full 12-layer stack.
Overview
Pipsgrowth EX14003 is a time-window scalper. There are no indicators in the source — the signal is the clock. On every tick, the EA reads the current server time, converts it into hour/minute/second through MqlDateTime, and decides whether the present moment falls inside a 'strong signal' window or a 'weak signal' window. If the answer is strong, it opens a buy. If the answer is weak, it opens a sell. That is the entire signal stack.
The window length depends on the active timeframe. The OnTick handler runs a switch statement with six cases — PERIOD_M1, PERIOD_M5, PERIOD_M15, PERIOD_H1, PERIOD_H4, and PERIOD_D1 — plus a default branch for any unrecognised value. Each case has its own pair of timing inputs under the '=== Signal Timing ===' group. M1 fires when time_struct.sec < InpM1SignalSeconds (default 30 seconds). M5 fires when time_struct.min % InpM5Modulo == 0 AND time_struct.sec < InpM5SignalSeconds — i.e. on every fresh M5 bar, for the first 30 seconds. M15 fires when time_struct.min % InpM15Modulo == 0 and seconds are below 30. H1 — the default operating frame, set by the global g_InpTimeframe = PERIOD_H1 initialised at compile time — fires when time_struct.min < InpH1SignalMinutes, which is 5 minutes by default. H4 fires on every H4 bar with time_struct.hour % InpH4Modulo == 0 and minutes under 15. D1 fires when hour-of-day is under 2. The default branch uses current_time % InpDefaultModulo < InpDefaultSignalSeconds for any unsupported timeframe.
The mental model: the EA assumes the opening half-minute to quarter-hour of every fresh bar carries a directional impulse and trades long into it. Everything else — 99% of an M1 bar, 96% of an H1 bar, 92% of an H4 bar — is treated as a sell window. There is no price-action check, no volatility filter, no spread filter, no news guard, no session filter, no day-of-week filter. Time alone decides the side. The only external inputs that gate entries are the position-count check and the floating-loss kill.
Lot sizing is a balance treadmill. CalculateLot() returns StartLot + LotStep * (AccountBalance / BalanceStep), normalised to InpLotDecimals (2). With the defaults that resolves to 0.03 + 0.01 * (balance / 200). On the recommended $100 deposit you trade 0.03 lot. At $1,000 you trade 0.08 lot. At $5,000 you trade 0.28 lot. At $20,000 you trade 1.03 lot. The lot grows linearly with balance forever — there is no ceiling, no risk-percent cap, no equity-curve throttle, and no drawdown-based de-risking. Combined with the eight-trades-per-direction cap and the $100 absolute floating-loss kill (MaxLoss), the EA will grow into a serious position size if the account survives long enough for the math to compound.
Trade management is hard-coded into OpenTrade. TP is TakeProfitPoints * _Point (10 points default). For a five-digit forex pair that is 1 pip; for XAUUSD with 2 decimals (where _Point = 0.01) it is 10 cents; for 3-decimal gold (_Point = 0.001) it is 1 cent. The comment '10 pips' in the source is a label, not a guarantee — the actual pip value depends on broker digits. SL is price * InpStopLossPercent (0.5% of price), so on a $3,000 XAUUSD quote the stop is $15 away from entry. That is the asymmetry: SL is roughly a hundred times larger than TP on a typical gold tick. A single SL hit absorbs roughly a hundred TP wins, which means the strategy needs an extraordinarily high win rate to break even — and the source provides no signal logic that could deliver that.
Position caps are guarded by CountOpenPositions(direction). The implementation has a structural MQL5 mistake: it calls PositionSelect(InpSymbolName) inside a for (long i = 0; i < PositionsTotal(); i++) loop without using PositionGetTicket(i) to navigate the position list. In MQL5, PositionSelect is a symbol-based lookup, not an index-based one — so the loop is effectively a no-op that always re-selects the same position. The count is bound to whatever the symbol selector lands on, not the iteration. OpenTrade() then checks currentOpenTrades >= MaxTrades (default 8) before sending, so the safety is 'do not open more than 8 per direction' but the count itself is unreliable in the presence of multiple positions on the symbol. MaxHedges is defined in the inputs (default 1) but never read by any function in the file — it is a dead input that pretends to be a recovery cap.
Three retry helpers sit at the bottom of the file — TryClose_EX14003, TryClosePartial_EX14003, and TryModify_EX14003. They are correctly written: 3-attempt loops with 100 or 200 ms Sleep() calls on REQUOTE / TIMEOUT / PRICE_OFF / PRICE_CHANGED, returning true on the first TRADE_RETCODE_DONE. But the actual trade lifecycle uses raw OrderSend(request, result) in OpenTrade() — no retry, no partial-close path, no SL/TP modification path. The helpers are scaffolding for a future build that was never finished. The g_trade_wrappers_EX14003 CTrade instance they wrap is also unused in the live code.
Filling mode is auto-detected through GetFillingMode(), which checks SYMBOL_FILLING_MODE and returns FOK if the broker allows it, otherwise IOC, otherwise RETURN. For XAUUSD on most modern ECN/RAW brokers, FOK or IOC is available and the EA takes whichever the broker advertises. Deviation is fixed at 5 points; the source comment says 'smaller to avoid issues' but does not explain what issues.
Pacing. On every tick the EA prints the bid/ask to the journal — that is the loudest signal in the file that this is a diagnostic-grade build, not a production-tuned one. The MaxLoss check runs first on each tick: if AccountBalance - AccountEquity > MaxLoss (default $100), the EA stops placing new orders but does not close the ones already open. There is no trailing stop, no break-even move, no time-based exit, no equity-protection switch. A trade either hits TP, hits SL, or sits. The only way out of a drawdown is the broker hitting the static SL.
The default InpTimeframe input is invalid. The input declares values 1–7 (M1, M5, M15, M30, H1, H4, D1) but the default is 8. The internal g_InpTimeframe is a global initialised to PERIOD_H1 at compile time and never reassigned from InpTimeframe in OnInit. This means changing the InpTimeframe dropdown in MT5 has no effect — the EA always runs the H1 case. Treat the input as cosmetic until a future build wires InpTimeframe into g_InpTimeframe. The OnInit function is also absent from the file — there is no input validation, no handle setup, no pre-flight check.
What to expect in a backtest. The strategy has no directional bias. On H1 it will buy during the first 5 minutes of every hour and sell during the remaining 55. With TP at 10 points and SL at 0.5% of price, the math works out to roughly a 1:100 reward-to-risk ratio per trade. Even with a 90% win rate, the expected value per trade is negative once spread and commission are included, because the rare loss is roughly 100× the typical win. The strategy will print a long, flat, slightly positive curve on a commission-free historical feed with zero slippage, and a slow bleed on a realistic broker with commissions, slippage, and variable spread. Do not read the backtest equity line as evidence of edge — it is evidence of take-profit clustering plus the absence of slippage simulation in the MT5 strategy tester.
Who should run it. This is a curiosity piece, not a deployable strategy. The interesting parts are: the modular time-window switch with per-timeframe configurable windows, which is a clean template for bar-open momentum research; the balance-treadmill lot sizing, which is a clean example of a fixed-fraction-without-cap pattern; and the bug surface in CountOpenPositions, which is a real-world example of why PositionGetTicket matters in MQL5 position iteration. If you are studying how a 'bare minimum' tick-driven MT5 EA can be wired up with no indicators, this file is short enough to read in one sitting. If you are looking for a profitable gold scalper, look elsewhere in the catalogue.
Strategy Deep Dive
EX14003 runs a single switch on every tick driven entirely by server clock, not by any indicator. The MqlDateTime decomposition feeds six per-timeframe branches: M1 watches time_struct.sec < InpM1SignalSeconds, M5 watches time_struct.min % InpM5Modulo == 0 && time_struct.sec < InpM5SignalSeconds, M15 mirrors M5 with the M15 divisor, H1 watches time_struct.min < InpH1SignalMinutes, H4 watches time_struct.hour % InpH4Modulo == 0 && time_struct.min < InpH4SignalMinutes, and D1 watches time_struct.hour < InpD1SignalHours. A 'strong' result calls OpenTrade(1) for a buy; a 'weak' result calls OpenTrade(-1) for a sell. OpenTrade() sizes the lot from the balance treadmill, looks up filling mode, attaches the static TP and percentage SL, and fires a raw OrderSend with no retry wrapper. The retry helpers TryClose / TryClosePartial / TryModify sit at the bottom of the file, correctly written, but are never invoked because the live code path uses bare OrderSend. The MaxLoss gate (AccountBalance - AccountEquity > MaxLoss, default $100) runs first on every tick and freezes new orders if floating drawdown breaches the cap, but it does not close anything that is already open. CountOpenPositions() has a known MQL5 iteration bug — it loops the position index but selects by symbol inside the loop, so the count is bound to whichever position the symbol selector lands on, not the iteration. The g_InpTimeframe global is hard-coded to PERIOD_H1 at compile time, making the user-facing InpTimeframe input (default 8, an invalid value) effectively cosmetic.
Entries are pure time triggers with no price or indicator logic. On every new bar of the selected timeframe, the EA opens a buy during the opening 'strong signal' window — first 30 seconds of M1, first 30 seconds of M5/M15, first 5 minutes of H1, first 15 minutes of H4, first 2 hours of D1. Outside that window the EA opens a sell on every tick. Lot size grows linearly with balance: StartLot + LotStep × (AccountBalance / BalanceStep), so the position gets bigger the longer the account survives.
Exits are handled entirely by the static TP and SL attached to each position at entry. TakeProfitPoints (default 10) × _Point is the TP distance; price × InpStopLossPercent (0.5% default) is the SL distance. There is no trailing stop, no break-even move, no time-based exit, no signal-driven exit. The only external exit override is the MaxLoss check: if floating drawdown exceeds MaxLoss (default $100), the EA stops opening new orders but leaves existing positions to close at their static SL/TP.
Stop loss is 0.5% of the entry price by default (InpStopLossPercent = 0.005), set as a static value on each order. On a $3,000 XAUUSD quote that places the stop $15 from entry; on $2,000 it is $10. There is no global drawdown cap at the EA level beyond the $100 MaxLoss floating-loss kill, which only halts new entries rather than closing losing positions.
Take profit is fixed at 10 points × _Point (TakeProfitPoints = 10) — equivalent to 10 cents on 2-decimal XAUUSD, 1 cent on 3-decimal XAUUSD, or 1 pip on 5-digit forex. The TP is roughly 1/100th the size of the SL, meaning the strategy needs a 99%+ win rate to break even at the trade level. There is no basket TP, no partial close, no scaling out.
Recommended balance: $100 minimum, $1,000+ for safer operation given the balance-treadmill lot sizing that grows linearly without a cap. The lot on $1,000 is 0.08, on $5,000 is 0.28 — a strong intraday move against an 8-position stack can produce meaningful drawdown quickly. Use an ECN or RAW spread broker because TP is only 10 points (1 cent on 3-decimal gold) and a wide spread will eat the entire reward on a high percentage of trades. Best on XAUUSD H1 with the default 5-minute strong-signal window. Avoid running it during low-liquidity sessions — the time-window logic treats every minute identically, so Asian-session H1 opens are as likely to fire as London or New York opens. This is a research template, not a production strategy: study the time-window switch and the fixed-fraction lot pattern, then disable the EA before going live.
Strategy Logic
Pipsgrowth EX14003 Scalper — Strategy Logic Analysis (from .mq5 source)
Family: Scalper
Magic: 22214003
Version: 2.00
BRIEF:
Timing-based scalper that uses configurable signal windows across multiple timeframes (M1-D1). Opens buy positions during strong signal windows and sell positions otherwise, with fixed percentage stop-loss and balance-based lot progression
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
CalculateFixedStopLoss()CalculateLot()CountOpenPositions()OpenTrade()TryClose_EX14003()TryClosePartial_EX14003()TryModify_EX14003()
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (25 total across 5 groups):
- [=== Identity ===]
InpMagicNumber=22214003// Magic number for trade identification - [=== Identity ===]
InpTradeComment= "Psgrowth.com Expert_14003" // Trade comment - [=== Trading ===]
StartLot=0.03// Minimum lot size - [=== Trading ===]
LotStep=0.01// Step for increasing lot size - [=== Trading ===]
BalanceStep= 200 // Step for increasing lot size - [=== Trading ===]
TakeProfitPoints= 10 // Take profit in points (10 pips) - [=== Trading ===]
MaxHedges= 1 // Max hedges allowed for recovery - [=== Trading ===] Deviation = 5 //
Slippage(smaller to avoid issues) - [=== Trading ===]
InpSymbolName= "XAUUSD" // Corrected tradingInpSymbolName - [=== Trading ===]
MaxTrades= 8 // Max number of trades allowed (8 max) - [=== Trading ===]
MaxLoss= 100 // Maximum allowed loss before stopping trading - [=== Trading ===]
InpTimeframe= 8 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Timeframe for analysis - [=== Risk ===]
InpStopLossPercent=0.005// Stop Loss percentage (0.5% =0.005) - [=== Risk ===]
InpLotDecimals= 2 // Lot size decimal places - [=== Signal Timing ===]
InpM1SignalSeconds= 30 //M1: Signal window in seconds - [=== Signal Timing ===]
InpM5SignalSeconds= 30 //M5: Signal window in seconds - [=== Signal Timing ===]
InpM15SignalSeconds= 30 //M15: Signal window in seconds - [=== Signal Timing ===]
InpH1SignalMinutes= 5 //H1: Signal window in minutes - [=== Signal Timing ===]
InpH4SignalMinutes= 15 //H4: Signal window in minutes - [=== Signal Timing ===]
InpD1SignalHours= 2 //D1: Signal window in hours - [=== Signal Timing ===]
InpDefaultSignalSeconds= 30 // Default: Signal window in seconds - [=== Modulo Divisors ===]
InpM5Modulo= 5 //M5timeframe modulo - [=== Modulo Divisors ===]
InpM15Modulo= 15 //M15timeframe modulo - [=== Modulo Divisors ===]
InpH4Modulo= 4 //H4timeframe modulo - [=== Modulo Divisors ===]
InpDefaultModulo= 60 // Default timing modulo
// Pipsgrowth EX14003 Scalper — Execution Flow (from source analysis)
// Family: Scalper
// Timing-based scalper that uses configurable signal windows across multiple timeframes (M1-D1). Opens buy positions during strong signal windows and sell positions otherwise, with fixed percentage stop-loss and balance-based lot progression
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 from the Navigator onto any chart (M1 or M5 recommended)
- 7In the EA dialog, enable Allow Algo Trading and set your lot size
- 8Click OK — the EA will begin trading automatically
EA Parameters
| Parameter | Default | Description |
|---|---|---|
| InpMagicNumber | 22214003 | Magic number for trade identification |
| InpTradeComment | "Psgrowth.com Expert_14003" | Trade comment |
| StartLot | 0.03 | Minimum lot size |
| LotStep | 0.01 | Step for increasing lot size |
| BalanceStep | 200 | Step for increasing lot size |
| TakeProfitPoints | 10 | Take profit in points (10 pips) |
| MaxHedges | 1 | Max hedges allowed for recovery |
| Deviation | 5 | Slippage (smaller to avoid issues) |
| InpSymbolName | "XAUUSD" | Corrected trading InpSymbolName |
| MaxTrades | 8 | Max number of trades allowed (8 max) |
| MaxLoss | 100 | Maximum allowed loss before stopping trading |
| InpTimeframe | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Timeframe for analysis |
| InpStopLossPercent | 0.005 | Stop Loss percentage (0.5% = 0.005) |
| InpLotDecimals | 2 | Lot size decimal places |
| InpM1SignalSeconds | 30 | M1: Signal window in seconds |
| InpM5SignalSeconds | 30 | M5: Signal window in seconds |
| InpM15SignalSeconds | 30 | M15: Signal window in seconds |
| InpH1SignalMinutes | 5 | H1: Signal window in minutes |
| InpH4SignalMinutes | 15 | H4: Signal window in minutes |
| InpD1SignalHours | 2 | D1: Signal window in hours |
| InpDefaultSignalSeconds | 30 | Default: Signal window in seconds |
| InpM5Modulo | 5 | M5 timeframe modulo |
| InpM15Modulo | 15 | M15 timeframe modulo |
| InpH4Modulo | 4 | H4 timeframe modulo |
| InpDefaultModulo | 60 | Default timing modulo |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX14003 od10leporadi — timing-based multi-TF scalper, full 12-layer stack."
#include <Trade\Trade.mqh>
//Constants
ENUM_TIMEFRAMES MapTimeframeInt(int tf)
{
switch(tf)
{
case 1: return PERIOD_M1;
case 2: return PERIOD_M5;
case 3: return PERIOD_M15;
case 4: return PERIOD_M30;
case 5: return PERIOD_H1;
case 6: return PERIOD_H4;
case 7: return PERIOD_D1;
default: return PERIOD_H1;
}
}
ENUM_APPLIED_PRICE MapAppliedPriceInt(int ap)
{
switch(ap)
{
case 1: return PRICE_CLOSE;
case 2: return PRICE_OPEN;
case 3: return PRICE_HIGH;
case 4: return PRICE_LOW;
case 5: return PRICE_MEDIAN;
case 6: return PRICE_TYPICAL;
case 7: return PRICE_WEIGHTED;
default: return PRICE_CLOSE;
}
}
ENUM_TIMEFRAMES g_InpTimeframe = PERIOD_H1;
input group "=== Identity ==="
input ulong InpMagicNumber = 22214003; // Magic number for trade identification
input string InpTradeComment = "Psgrowth.com Expert_14003"; // Trade comment
ENUM_TIMEFRAMES MapTimeframeInt(int tf)
{
switch(tf)
{
case 1: return PERIOD_M1;
case 2: return PERIOD_M5;
case 3: return PERIOD_M15;
case 4: return PERIOD_M30;
case 5: return PERIOD_H1;
case 6: return PERIOD_H4;
case 7: return PERIOD_D1;
default: return PERIOD_H1;
}
}
ENUM_APPLIED_PRICE MapAppliedPriceInt(int ap)
{
switch(ap)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 Scalping strategy EAs from our library
Pipsgrowth EX14020 Scalper
Pipsgrowth.com EX14020 AIXAUUSDScalper — AI-assisted XAUUSD scalper, full 12-layer stack.
Pipsgrowth EX10006 Momentum-Scalper
Pipsgrowth.com EX10006 USDJPY Scalper — USDJPY pullback momentum scalper, full 12-layer stack.
Pipsgrowth EX14021 Scalper
Pipsgrowth.com EX14021 EURUSDScalper — BB + MACD divergence scalper, full 12-layer stack.
Community
Educational purposes only. Do NOT use with real money. Test on demo accounts only.