Pipsgrowth EX14009 Scalper
MT5 Expert Advisor (Open Source) · XAUUSD · M1
Pipsgrowth.com EX14009 Forex Fraus M1 — WPR extreme scalper, full 12-layer stack.
Overview
The EX14009 Forex Fraus M1 sits at the minimalist end of the PipsGrowth scalper family. Where most EX14 cousins run an indicator stack, a regime router, and a multi-stage exit pipeline, this one watches a single Williams Percent Range reading on the M1 bar and acts only at the most extreme tails of its distribution. The whole decision tree on a new bar reduces to three lines: read WPR[0], compare it to -99.9 and -0.1, and either open a buy, open a sell, or do nothing. That focus is the design.
Williams Percent Range is a momentum oscillator bound between 0 and -100. Values near 0 mean the close printed near the high of the lookback window; values near -100 mean it printed near the low. A standard 14-period WPR is noisy and fires constantly on M1. The strategy instead samples WPR over an unusually long 360-bar window — six hours of M1 bars — which dampens the oscillator into a slow-moving envelope. On that smoothed curve, reaching below -99.9 is genuinely rare: price has spent essentially the entire prior six hours pinned near the bottom of its range. The buy condition (WPR < -99.9) only fires when the market is in a deeply capitulated state on a slow lookback, not on a brief intrabar dip. The mirror condition for sells (WPR > -0.1) is the same idea on the overbought side.
When the long condition fires, the entry is executed through OpenBuy() at the current ask with InpStopLoss=50 pips below and InpTakeProfit=150 pips above — a fixed 1:3 risk-reward. The code computes sl = Ask - ExtStopLoss where ExtStopLoss = InpStopLoss * m_adjusted_point (the adjusted point doubles on 3/5-digit brokers, so 50 pips stays 50 pips regardless of quote precision). The same pattern runs in mirror for sells: bid minus 50 pips for SL, bid minus 150 pips for TP. If InpCloseOpposite is true (the default), opening a buy immediately closes any open sell on the same magic and vice versa, so the EA never holds opposing positions simultaneously.
The trailing system is unusually tight for a system that brackets 200 pips of total range. InpTrailingStop=1 pip with InpTrailingStep=1 pip means the stop ratchets one pip at a time, but only after the trade has moved at least ExtTrailingStop + ExtTrailingStep (two pips) in profit. The Trailing() function runs every tick, not just on new bars, so the stop is re-evaluated on each price change. The combination of a 150-pip TP and a 1-pip trailing ratchet means the EA tends to capture most of a fast M1 spike: the trade can run to TP untouched, or the trailing stop can lock in profit as price reverses. There is no partial-close, no breakeven step, no second-stage trail — the trailing is a single, atomic, never-loosens ratchet.
Position management is split between two execution paths. The entry path runs on new bar only — OnTick guards on time_0 == PrevBars and bails out if the bar hasn't changed since the last evaluation, which means at most one signal per minute per direction. The trailing path runs every tick. The retry helpers TryClose_EX14009, TryClosePartial_EX14009, and TryModify_EX14009 are defined but only TryClose_EX14009 (used in ClosePositions) and TryModify_EX14009 (used in Trailing) are actually wired into the live flow; TryClosePartial_EX14009 is dead code. Each retry helper makes three attempts and sleeps 100–200 ms on REQUOTE / TIMEOUT / PRICE_OFF / PRICE_CHANGED before giving up. Slippage tolerance is set via m_trade.SetDeviationInPoints(10).
The time gate is Timecontrol(), which uses InpStartHour=7 and InpEndHour=17 by default. The logic is unusual: it handles both overnight wraps (InpStartHour > InpEndHour, allowing the window to cross midnight) and same-day windows (InpStartHour < InpEndHour, allowing only hours within the range). The default 7-17 covers the London and New York overlap on most broker timezones, which is when XAUUSD (the suggested pair) sees the cleanest directional moves. The control returns true if InpTimecontrol is disabled, so flipping the boolean disables the gate entirely.
There is no global drawdown cap, no equity-curve protection, no daily loss limit, and no max-position guard beyond the close-opposite behavior. Lot sizing is fixed via InpLots=0.1; there is no risk-percentage calc, no balance scaling, no recovery multiplier. The OnInit() block adjusts for 3/5-digit quotes, validates InpLots against the broker's SYMBOL_VOLUME_MIN/MAX/STEP, sets the magic via m_trade.SetExpertMagicNumber(m_magic), picks a filling policy by symbol, and creates the single handle_iWPR indicator handle. OnDeinit() is empty — the handle is released automatically when the EA unloads.
The WPR period of 360 is the single most important parameter to understand. Drop it to 14 and you get the standard noisy WPR, which fires constantly on M1 and produces whipsaw losses against the trend. Raise it further (e.g. 720 for 12 hours) and the signals become so rare that the EA trades only once a day. The default 360 is calibrated for XAUUSD's typical M1 volatility profile: deep capitulation events on a six-hour window happen a few times per session, and the 1:3 RR with a 1-pip trailing stop is sized to capture the snap-back without getting stopped out by intrabar noise.
For live use, the practical constraints are broker-side, not strategy-side. A 50-pip SL on XAUUSD M1 is roughly $5 of risk at 0.1 lot on most brokers, and a 150-pip TP is roughly $15. The EA needs an ECN or RAW-spread account so the WPR extreme reading isn't masked by a wide spread. There is no recovery multiplier, no martingale, no grid — every trade is standalone with a fixed 1:3 bracket. Backtests on XAUUSD M1 with default parameters are most informative across a 6-month window that includes both a trending and a ranging regime, since the WPR-at-extremes approach performs very differently in each.
Strategy Deep Dive
Williams Percent Range on a 360-bar window produces a slow-moving envelope that almost never reaches its extreme tails — the buy condition WPR < -99.9 only fires when price has spent essentially the whole prior six hours pinned to the low of the range. On a new M1 bar the EA reads the latest WPR value through iWPRGet(0), checks it against the two thresholds, and either opens a buy, opens a sell, or skips. OpenBuy/OpenSell submit via m_trade at the current ask/bid with SL and TP computed from m_adjusted_point so the bracket is identical on 3/5-digit quotes; on a successful fill with InpCloseOpposite enabled, the opposite-direction positions on the same magic are closed through TryClose_EX14009. The Trailing() function is the only piece that runs on every tick — it walks PositionsTotal in reverse and tightens the stop by one pip once price has cleared ExtTrailingStop+ExtTrailingStep. The Timecontrol() gate returns false outside 7-17 by default (London and New York overlap on most broker clocks) and is bypassed entirely if InpTimecontrol is set to false. The header advertises 12 layers (REGIME/SIGNAL/ENTRY/CONFIRM/NO-TRADE/CAPITAL CAP/RISK/SIZING/MANAGE/EXIT/SCALING/OnTester) but the actual code collapses to those four moving parts — single indicator, threshold check, trailing tick-loop, time gate — with no equity-curve protection, no OnTester, and no recovery multiplier in sight.
On a new M1 bar the EA reads Williams Percent Range over a 360-bar window through iWPRGet(0). A long opens when WPR[0] drops below -99.9 — extreme oversold on the six-hour smoothed curve — at the current ask with SL 50 pips below and TP 150 pips above (1:3 fixed RR). A short opens when WPR[0] rises above -0.1 (extreme overbought) at the current bid with the mirror bracket. With InpCloseOpposite=true (default), opening a buy immediately closes any open sell on magic 22214009 and vice versa, so the EA never holds opposing positions simultaneously.
Each trade carries a fixed 150-pip take-profit from entry, with no partials — the position either hits TP or trails out. The Trailing() function runs every tick and ratchets the stop one pip higher (for longs) or lower (for shorts) once price has moved at least 2 pips beyond the current stop. There is no break-even step, no second-stage trail, and no time-based exit; an open position closes on TP, on the trailing stop, or on a reverse-signal close when InpCloseOpposite is enabled.
Stop loss is set at 50 pips from entry on every trade (ExtStopLoss = InpStopLoss * m_adjusted_point, with adjusted_point = point * 10 on 3/5-digit brokers). With TP at 150 pips, the fixed bracket is a 1:3 risk-reward. The SL is only ever tightened by the trailing ratchet — it is never moved against the position, never widened, and never replaced by a basket-level stop.
Take profit is a hard 150-pip target placed on the order at entry via ExtTakeProfit = InpTakeProfit * m_adjusted_point. There is no partial-close, no scaled exit, and no basket TP — the only exits are the 150-pip TP, the 1-pip trailing ratchet, or a reverse-signal close (when InpCloseOpposite is enabled).
Minimum recommended balance: $100 per the EA's minDeposit, with $1,000 preferred for any meaningful scaling on XAUUSD — at the default 0.1 lot the 50-pip SL is roughly $5 of risk per trade. The fixed 50/150-pip bracket and the WPR extreme reading both demand an ECN or RAW-spread account so the threshold isn't masked by a wide quote. The 7-17 default time gate targets the London and New York overlap on most broker clocks, which is when XAUUSD M1 prints the cleanest capitulation and blow-off moves. Risk level is HIGH: there is no drawdown cap, no recovery multiplier, no daily loss limit, and no dynamic lot — every trade is a full 1:3 bracket, so position sizing is the trader's responsibility.
Strategy Logic
Pipsgrowth EX14009 Scalper — Strategy Logic Analysis (from .mq5 source)
Family: Scalper
Magic: 22214009
Version: 2.00
BRIEF:
M1 scalper using Williams Percent Range (WPR) indicator for extreme overbought/oversold detection. Buys at WPR < -99.9 and sells at WPR > -0.1, with trailing stops, time control, and close-opposite-position logic
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
OnTradeTransaction()RefreshRates()CheckVolumeValue()iWPRGet()OpenBuy()OpenSell()PrintResultTrade()Trailing()PrintResultModify()Timecontrol()ClosePositions()TryClose_EX14009()- ...and 2 more
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (12 total across 4 groups):
- [=== Identity ===]
m_magic=22214009// magic number - [=== Identity ===]
InpTradeComment= "Psgrowth.com Expert_14009" // Trade comment - [=== Trading ===]
InpLots=0.1// Lots - [=== Trading ===]
InpStopLoss= 50 // StopLoss(in pips) - [=== Trading ===]
InpTakeProfit= 150 // TakeProfit(in pips) - [=== Trading ===]
InpTrailingStop= 1 // TrailingStop(in pips) - [=== Trading ===]
InpTrailingStep= 1 // TrailingStep(in pips) - [=== Trading ===]
InpCloseOpposite=true// Use close opposite positions - [=== Signal ===] Inp_WPR_calc_period = 360 //
WPR: averaging period - [=== Time Control ===]
InpTimecontrol=true// Use Timecontrol - [=== Time Control ===]
InpStartHour= 7 // Start hour - [=== Time Control ===]
InpEndHour= 17 // End hour
// Pipsgrowth EX14009 Scalper — Execution Flow (from source analysis)
// Family: Scalper
// M1 scalper using Williams Percent Range (WPR) indicator for extreme overbought/oversold detection. Buys at WPR < -99.9 and sells at WPR > -0.1, with trailing stops, time control, and close-opposite-position logic
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 |
|---|---|---|
| m_magic | 22214009 | magic number |
| InpTradeComment | "Psgrowth.com Expert_14009" | Trade comment |
| InpLots | 0.1 | Lots |
| InpStopLoss | 50 | Stop Loss (in pips) |
| InpTakeProfit | 150 | Take Profit (in pips) |
| InpTrailingStop | 1 | Trailing Stop (in pips) |
| InpTrailingStep | 1 | Trailing Step (in pips) |
| InpCloseOpposite | true | Use close opposite positions |
| Inp_WPR_calc_period | 360 | WPR: averaging period |
| InpTimecontrol | true | Use Timecontrol |
| InpStartHour | 7 | Start hour |
| InpEndHour | 17 | End hour |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX14009 Forex Fraus M1 — WPR extreme scalper, full 12-layer stack."
//---
#include <Trade\PositionInfo.mqh>
#include <Trade\Trade.mqh>
#include <Trade\SymbolInfo.mqh>
CPositionInfo m_position; // trade position object
CTrade m_trade; // trading object
CSymbolInfo m_symbol; // symbol info object
//--- input parameters
input group "=== Identity ==="
input ulong m_magic=22214009; // magic number
input string InpTradeComment = "Psgrowth.com Expert_14009"; // Trade comment
input group "=== Trading ==="
input double InpLots = 0.1; // Lots
input ushort InpStopLoss = 50; // Stop Loss (in pips)
input ushort InpTakeProfit = 150; // Take Profit (in pips)
input ushort InpTrailingStop = 1; // Trailing Stop (in pips)
input ushort InpTrailingStep = 1; // Trailing Step (in pips)
input bool InpCloseOpposite = true; // Use close opposite positions
input group "=== Signal ==="
input int Inp_WPR_calc_period = 360; // WPR: averaging period
input group "=== Time Control ==="
input bool InpTimecontrol = true; // Use Timecontrol
input uchar InpStartHour = 7; // Start hour
input uchar InpEndHour = 17; // End hour
//---
ulong m_slippage=10; // slippage
double ExtStopLoss=0.0;
double ExtTakeProfit=0.0;
double ExtTrailingStop=0.0;
double ExtTrailingStep=0.0;
int handle_iWPR; // variable for storing the handle of the iWPR indicator
double m_adjusted_point; // point value adjusted for 3 or 5 points
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
if(InpTrailingStop!=0 && InpTrailingStep==0)
{
string text=(TerminalInfoString(TERMINAL_LANGUAGE)=="Russian")?
"Трейлинг невозможен: параметр \"Trailing Step\" равен нулю!":
"Trailing is not possible: parameter \"Trailing Step\" is zero!";
Alert(__FUNCTION__," ERROR! ",text);
return(INIT_PARAMETERS_INCORRECT);
}
//---
if(!m_symbol.Name(Symbol())) // sets symbol name
return(INIT_FAILED);
RefreshRates();
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.