Pipsgrowth EX14008 Scalper
MT5 Expert Advisor (Open Source) · XAUUSD · M5, H1
Pipsgrowth.com EX14008 AK-47 Scalper EA — pending stop order scalper, full 12-layer stack.
Overview
Pipsgrowth EX14008 (internally branded "AK-47 EA") is a pending-stop scalper with an unusual design choice: it carries no technical indicators, generates no momentum or regime signal, and places its order in the same direction on every cycle. The only live branch in the EA's entry function hard-codes OrdType = ORDER_TYPE_SELL, so the buy-stop arm is unreachable dead code and the bot's real behaviour is a continuous sell-stop posting at half the stop distance below the bid, with a fixed pip stop, fixed pip target, and a trailing function that chases price both before and after the order is triggered.
Entry mechanics. On every tick inside the trading window the EA walks the position and pending-order books. If neither is present — isOrder is reset to false by UpdateOrders() — it sends a single m_trade.SellStop at OpenPrice = Bid - InpSL_Pips/2 * Pips2Double. The stop-loss for the resulting position is set at Ask + InpSL_Pips/2 and the take-profit at OpenPrice - InpTP_Pips. Because Ask and Bid differ by the spread, the total distance from OpenPrice to SL is approximately InpSL_Pips + spread and from OpenPrice to TP is InpTP_Pips. The default SL of 3.5 pips and TP of 7 pips gives a 2:1 reward-to-risk ratio at the moment the order fills, assuming a normal XAUUSD spread.
No-signal, no-confirm architecture. The header advertises a 12-layer stack — REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester — but the implementation covers four. There is no regime classifier, no oscillator-based signal, no confirmation stage, no scaling layer, and no custom OnTester() metric. The "NO-TRADE" layer is the only filter, and it stacks five sequential checks: spread ≤ 5 points, time window, freeze-level distance, stop-level distance, and margin availability. "ENTRY" is the single pending-stop. "MANAGE" is the TrailingStop() function. "RISK" is the CalculateVolume() block. The remaining eight layers are aspirational header text, not active code.
The trailing function has two jobs. TrailingStop() is called every tick after UpdateOrders(). First, it walks every open position carrying magic 22214008 and, if the position's current distance from the broker-set stop is greater than InpSL_Pips, ratchets the stop inward to Bid - InpSL_Pips for buys or Bid + InpSL_Pips for sells via TryModify_EX14008(). Second — and this is the more unusual half — the same function walks the pending-order book and re-anchors each pending stop's open price so that the SL stays at exactly InpSL_Pips/2 from the current bid (for sell-stops) or ask (for buy-stops). The net effect: as price falls through the sell-stop activation level, the order re-prices lower to maintain its half-pip-from-bid gap. Once triggered, the position-side trailing then takes over and the order is no longer re-anchored.
Risk and sizing. Lot sizing is risk-percent-based via CalculateVolume(). The formula is LotSize = InpRisk * m_account.FreeMargin() / 100000, then floored to the nearest Inpuser_lot step (default 0.01), with a hard floor of Inpuser_lot and a hard ceiling at the broker's LotsMax(). The default InpRisk of 3% on a $1,000 account produces roughly 0.3 lots at typical XAUUSD free-margin levels, and on a $100 account the floor of 0.01 takes over. The isVolume_Percent toggle (default true) switches the calculation to a fixed Inpuser_lot mode instead. There is no per-trade stop-distance-based lot calc, no martingale, no recovery layer, and no global account-level drawdown cap — the only loss-control surface is the per-order fixed stop.
Session and broker gate. The trading-time filter (InpTimeFilter, default on) accepts a 24-hour clock with start hour, start minute, end hour, and end minute. The default window of 02:30 → 21:00 spans Asian open through most of the New York session in broker time. The TimeCurrent() >= timeStart && TimeCurrent() < timeEnd test is local-clock based, not server-GMT, so actual session coverage depends on the broker's server offset. The spread filter (InpMax_spread, default 5 points) is in raw SYMBOL_SPREAD units; on a 2-digit XAUUSD quote that is 5 USD of spread — a real but moderate gate for retail gold feeds, and an absolute block on standard retail accounts that quote 20-30 points during off-peak hours.
Pre-flight validation. Before any order is sent, OpenOrder() runs five guards in sequence: CheckSpreadAllow() against InpMax_spread; CheckVolumeValue(lot1) against the broker's SYMBOL_VOLUME_MIN/MAX/STEP; CheckOrderForFREEZE_LEVEL() for the activation price's distance from bid/ask; CheckStopLoss() for the stop's distance from the broker's SYMBOL_TRADE_STOPS_LEVEL; and CheckMoneyForTrade() for margin sufficiency. If any of the five fail, the order is skipped silently and the function returns without printing. The SetDeviationInPoints(slippage) is set to InpMax_slippage * 10 on 3/5-digit symbols and InpMax_slippage on 2/4-digit, defaulting to 3 pips of allowed slippage. The m_trade.SetTypeFillingBySymbol(m_symbol.Name()) line in OnInit() auto-detects FOK, IOC, or RETURN filling per the broker.
Defined but unused retry helpers. Three retry helpers — TryClose_EX14008(), TryClosePartial_EX14008(), and TryModify_EX14008() — are defined at the bottom of the file, each attempting three retries on REQUOTE, TIMEOUT, PRICE_OFF, or PRICE_CHANGED return codes, sleeping 200 ms (100 ms for modify) between attempts. None of them is actually called in the live code path: the main TrailingStop() uses m_trade.OrderModify and m_trade.PositionModify directly, and there is no Close or ClosePartial call in the EA at all — once a position is open, exits happen only via the broker-side SL or TP or the trailing ratchet. The helpers are leftover EX14-family scaffolding preserved in source but never wired in.
Asymmetric activation as a slippage clip. The sell-stop activation sits at Bid - SL_Pips/2 rather than the conventional Bid - spread/2. On a successful fill, this means the entry price is slightly more favourable than the ask — effectively clipping half a pip of slippage per fill on a 3.5-pip SL configuration. The trade-off is thinner fill probability: the order sits further from price than a typical breakout pending would, so price has to actually break through the level rather than just touch it. With the 5-point spread gate and 3-pip slippage cap, fills happen most often when a real breakdown is in progress rather than on tick noise.
What you actually see on the chart. A single sell-stop posted just below the bid, sitting there through Asian hours, then through London, then through New York. When price breaks down through the level, the order fills, the position opens, and its stop begins trailing from the broker-set level inward. If price never reaches the activation level during the trading window, the pending order sits untouched until the next session. The chart comment prints the bot name, version, server time, day of week, configured trading window, and current spread on every tick — a small debugging convenience, with no on-chart signals and no indicator overlay. The position never scales out or in; the EA maintains at most one position or one pending order at a time.
Strategy Deep Dive
On every tick UpdateOrders() resets the global isOrder flag by scanning the position and pending-order books, and TrailingStop() then re-anchors each pending sell-stop's open price so its stop stays exactly InpSL_Pips/2 from the current bid. If the trading-time filter (InpTimeFilter, default on, 02:30 → 21:00) is satisfied and isOrder is still false, OpenOrder() runs five sequential pre-flight checks — spread, volume, freeze level, stop level, margin — and then sends a single m_trade.SellStop. The OpenOrder() function contains both a sell and a buy arm, but OrdType is hard-coded to ORDER_TYPE_SELL, so only the sell-stop arm ever executes. The three retry helpers TryClose_EX14008, TryClosePartial_EX14008, and TryModify_EX14008 are defined at the bottom of the file but are not called from any live code path — they are leftover EX14-family scaffolding. The chart Comment() prints the bot name, version, server time, day of week, configured trading window, and current spread on every tick.
The EA places a single pending sell-stop — the buy branch in OpenOrder() is unreachable dead code with OrdType hard-coded to ORDER_TYPE_SELL — at Bid minus InpSL_Pips/2 on every tick in the trading window when no position or pending order with magic 22214008 already exists. The resulting order's stop-loss is set at Ask plus InpSL_Pips/2 and take-profit at OpenPrice minus InpTP_Pips, so the 3.5/7 pip default pair gives a 2:1 reward-to-risk ratio at the moment the order fills.
Exits come from either the broker-side take-profit hit (fixed InpTP_Pips, default 7 pips) or the broker-side stop-loss hit (InpSL_Pips, default 3.5 pips). The TrailingStop() function ratchets the open-position stop to Bid plus or minus InpSL_Pips once price has moved more than InpSL_Pips in profit, so a winning position can be exited at a tighter stop than the broker originally set.
Each order has a fixed stop of InpSL_Pips (default 3.5 pips) split symmetrically around the activation price — half below for sell-stops, half above — and maintained at that exact distance by the pending-order ratchet inside TrailingStop(). There is no global account-level drawdown cap, no equity-protection block, no daily-loss limit, and no martingale recovery layer.
Fixed take-profit of InpTP_Pips (default 7 pips) measured from the activation price, not from the fill price — so the order books a 2:1 reward-to-risk ratio against the broker-set stop at the default 3.5/7 pair. Set InpTP_Pips to 0 to disable the take-profit and let the trailing ratchet be the only exit path.
Minimum recommended balance: $100 (the EA's hard floor via Inpuser_lot = 0.01), with $1,000+ preferred so the 3% risk percent actually produces a meaningful lot at typical XAUUSD free-margin levels. The 5-point spread gate and 3-pip slippage cap effectively require a low-spread ECN or raw-spread broker — on a standard retail account with 20-30 point XAUUSD spreads, most ticks will be rejected by CheckSpreadAllow(). Best run on XAUUSD M5 during the 02:30 → 21:00 default window (Asian + London + most of New York in broker time), on a server whose timezone aligns the open and close with that span.
Strategy Logic
Pipsgrowth EX14008 Scalper — Strategy Logic Analysis (from .mq5 source)
Family: Scalper
Magic: 22214008
Version: 2.00
BRIEF:
AK-47 Scalper EA using pending stop orders with fixed pip-based SL/TP, time filtering, trailing stops, and spread control. Places sell-stop or buy-stop orders with configurable risk-based or fixed lot sizing
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
OpenOrder()TrailingStop()UpdateOrders()CalculateVolume()CheckStopLoss_Takeprofit()CheckVolumeValue()CheckOrderForFREEZE_LEVEL()CheckMoneyForTrade()CheckSpreadAllow()CheckStopLoss()DayOfWeekDescription()RefreshRates()- ...and 3 more
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (14 total across 4 groups):
- [=== Identity ===]
InpMagicNumber=22214008// Magic Number - [=== Identity ===]
InpTradeComment= "Psgrowth.com Expert_14008" // TradeComment - [=== Money Settings ===]
isVolume_Percent=true// Allow Volume Percent - [=== Money Settings ===]
InpRisk= 3 // Risk Percentage ofBalance(%) - [=== Trading Settings ===] Inpuser_lot =
0.01// Lots - [=== Trading Settings ===]
InpSL_Pips=3.5//Stoploss(in Pips) - [=== Trading Settings ===]
InpTP_Pips= 7 //TP(in Pips) (0 = No TP) - [=== Trading Settings ===]
InpMax_slippage= 3 // Maximum slippageallow_Pips. - [=== Trading Settings ===]
InpMax_spread= 5 // Maximum allowed spread (in Point) (0 = floating) - [=== Trading Time Settings ===]
InpTimeFilter=true// Trading Time Filter - [=== Trading Time Settings ===]
InpStartHour= 2 // Start Hour - [=== Trading Time Settings ===]
InpStartMinute= 30 // Start Minute - [=== Trading Time Settings ===]
InpEndHour= 21 // End Hour - [=== Trading Time Settings ===]
InpEndMinute= 0 // End Minute
// Pipsgrowth EX14008 Scalper — Execution Flow (from source analysis)
// Family: Scalper
// AK-47 Scalper EA using pending stop orders with fixed pip-based SL/TP, time filtering, trailing stops, and spread control. Places sell-stop or buy-stop orders with configurable risk-based or fixed lot sizing
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 | 22214008 | Magic Number |
| InpTradeComment | "Psgrowth.com Expert_14008" | Trade Comment |
| isVolume_Percent | true | Allow Volume Percent |
| InpRisk | 3 | Risk Percentage of Balance (%) |
| Inpuser_lot | 0.01 | Lots |
| InpSL_Pips | 3.5 | Stoploss (in Pips) |
| InpTP_Pips | 7 | TP (in Pips) (0 = No TP) |
| InpMax_slippage | 3 | Maximum slippage allow_Pips. |
| InpMax_spread | 5 | Maximum allowed spread (in Point) (0 = floating) |
| InpTimeFilter | true | Trading Time Filter |
| InpStartHour | 2 | Start Hour |
| InpStartMinute | 30 | Start Minute |
| InpEndHour | 21 | End Hour |
| InpEndMinute | 0 | End Minute |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX14008 AK-47 Scalper EA — pending stop order scalper, full 12-layer stack."
#define ExtBotName "AK-47 EA" //Bot Name
#define Version "2.00"
//Import trade class
#include <Trade\PositionInfo.mqh>
#include <Trade\Trade.mqh>
#include <Trade\SymbolInfo.mqh>
#include <Trade\AccountInfo.mqh>
#include <Trade\OrderInfo.mqh>
//--- introduce predefined variables for code readability
#define Ask SymbolInfoDouble(_Symbol, SYMBOL_ASK)
#define Bid SymbolInfoDouble(_Symbol, SYMBOL_BID)
//--- input parameters
input group "=== Identity ==="
input int InpMagicNumber = 22214008; //Magic Number
input string InpTradeComment = "Psgrowth.com Expert_14008"; // Trade Comment
input group "=== Money Settings ==="
input bool isVolume_Percent = true; //Allow Volume Percent
input double InpRisk = 3; //Risk Percentage of Balance (%)
input group "=== Trading Settings ==="
input double Inpuser_lot = 0.01; //Lots
input double InpSL_Pips = 3.5; //Stoploss (in Pips)
input double InpTP_Pips = 7; //TP (in Pips) (0 = No TP)
input int InpMax_slippage = 3; //Maximum slippage allow_Pips.
input double InpMax_spread = 5; //Maximum allowed spread (in Point) (0 = floating)
input group "=== Trading Time Settings ==="
input bool InpTimeFilter = true; //Trading Time Filter
input int InpStartHour = 2; //Start Hour
input int InpStartMinute = 30; //Start Minute
input int InpEndHour = 21; //End Hour
input int InpEndMinute = 0; //End Minute
//--- Variables
int Pips2Points; // slippage 3 pips 3=points 30=points
double Pips2Double; // Stoploss 15 pips 0.015 0.0150
bool isOrder = false;
int slippage;
long acSpread;
string strComment = "";
CPositionInfo m_position; // trade position object
CTrade m_trade; // trading object
CSymbolInfo m_symbol; // symbol info object
CAccountInfo m_account; // account info wrapper
COrderInfo m_order; // pending orders object
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
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.