P
PipsGrowth
ScalpingOpen Source – Free

Pipsgrowth EX14006 Scalper

MT5 Expert Advisor (Open Source) · XAUUSD · M5, H1

Pipsgrowth.com EX14006 AggressiveScalperEA — multi-indicator aggressive scalper, full 12-layer stack.

Overview

Pipsgrowth EX14006 is a high-risk, ATR-anchored scalper that runs an exclusive-priority signal stack and tracks the account balance as aggressively as the price action. The EA is wired to trade on PERIOD_CURRENT (whatever chart it is dropped onto), and the source confirms the intended deployment is XAUUSD M5 to H1. Magic 22214006 identifies every order, and the entire trade cycle — entry, sizing, exits, daily kill, and even the strategy's self-shutdown — is sized off the live account balance, not off price or indicator levels.

The signal stack is a four-priority ladder in CheckEntrySignals(). Priority 1 is the mean-reversion oversold bounce: RSI(14)[0] below 30, RSI(14)[1] below 25, RSI rising bar-over-bar, the live close at or below the lower Bollinger Band (20, 2.0), the Stochastic(5, 3, 3) main line below 20 and crossing above its signal. All six conditions must align to fire a buy. Priority 2 is the mirror overbought reversal: RSI(14)[0] above 70, RSI(14)[1] above 75, RSI falling, close at or above the upper Bollinger Band, Stochastic main above 80 and crossing below its signal, sells. Priority 3 is the bullish trend-following continuation: market is bullish (close above the 20-period EMA and MACD main above its signal), RSI(14) momentum between 50 and 70, and a fresh MACD bullish crossover (current bar main>signal, previous bar main<=signal). Priority 4 is the bearish mirror with momentum between 30 and 50 and a fresh MACD bearish cross. The priorities are exclusive — once a higher-priority signal fires, the lower ones are not evaluated, which keeps the EA from stacking conflicting trades in the same bar.

The MarketCondition struct is built in AnalyzeMarket() from the same six indicator handles (handleRSI, handleMA, handleATR, handleBB, handleMACD, handleStoch, all on PERIOD_CURRENT with the periods given in the input group). The struct carries isTrending (true when the close-vs-EMA distance is more than 0.1% of price), isVolatile (true when the live ATR exceeds MinVolatility=0.0001), isBullish and isBearish flags built from price-vs-EMA and MACD main-vs-signal alignment, and three scalars: volatility (the raw ATR), momentum (the live RSI), and strength (a Bollinger-band-width percentage scaled by 1000 and clipped to 100). The struct is rebuilt every tick.

The position sizing is the centerpiece of the "aggressive" framing. CalculateLotSize() reads the live account balance, multiplies by RiskPerTrade=10.0 (a ten-percent risk per trade by default), divides by the ATR-anchored stop distance in points, then multiplies the result by a growthFactor of 1.0 + 0.5 × (balance - InitialBalance) / InitialBalance, capped at 2.0. So a $100 account trades the base lot, a $200 account trades 1.5× the base, a $500 account trades 2.0× the base (the cap), and anything above that stays at 2.0×. The growth factor is not a martingale in the recovery sense — it is a balance-curve scaler that increases aggression as the account grows, on the assumption that a growing balance can absorb proportionally larger per-trade risk. Combined with the 10% risk default and an ATR-based stop, the per-trade dollar risk on a $100 account with 1.5× ATR stop at default gold volatility (about $5 of stop distance) is roughly $1.50, but on a $1,000 account at the 2.0× growth cap with the same $5 stop, it is roughly $60 — a 40× swing in dollar risk for a 10× swing in account size. That asymmetry is the most aggressive structural choice in the build.

The SL and TP are ATR-scaled and adapt to volatility. The default branch in ExecuteBuy and ExecuteSell sets sl = ask - 1.5*ATR and tp = ask + TakeProfitFactor * 1.5*ATR for a buy, and the mirror for a sell. With TakeProfitFactor=2.0 the reward-to-risk is 2:1 in the default branch. When the market struct reports isVolatile=true, the same logic widens to sl = ask - 2.0*ATR and tp = ask + TakeProfitFactor * 2.0*ATR, which keeps the 2:1 reward-to-risk ratio intact but scales both stop and target up by a third. Prices are normalized to the symbol's tick size via NormalizePrice() so the broker's price-precision rules are respected. The filling mode is auto-detected in OnInit (FOK first, then IOC, then RETURN) and SetDeviationInPoints(10) sets a 10-point slippage cap on entry.

The position management runs five separate exit pathways. TrailingStop() activates when the live price has moved TrailingStart=20 points from the open in favor of the position, and ratchets the SL to currentPrice - TrailingStep=10 points (or the mirror for a sell), with a 1-way ratchet that only moves in the profitable direction. The partial-close branch in ManagePositions() closes 50% of the position's volume when the floating profit exceeds 2% of account balance. The loss-cut branch closes the position entirely when the floating loss exceeds 5% of account balance — a per-position kill that fires independently of the broker-side SL. The momentum-reversal branch closes a profitable buy when RSI(14) climbs above 70 and MACD flips negative, and the mirror for sells. The daily loss kill in IsDailyLossLimitReached() captures the day's start-of-day balance on the first tick of a new calendar day and blocks new entries once (dailyStartBalance - currentBalance) / dailyStartBalance * 100 > MaxDailyLoss=30.0%. The fifth exit is the broker-side SL and TP, which the EA sends with the order and which acts as the floor on the loss side.

The strategy's self-shutdown is unusual. OnTick() checks if(account.Balance() >= TargetBalance=1000.0) at the very top and returns without doing anything else. With the default InitialBalance=100.0 and TargetBalance=1000.0, the EA's first act once the account hits $1,000 is to stop opening new trades — it does not close existing ones, it just stops adding to them. The combination of the aggressive 10% risk per trade, the 2.0× growth factor on lot size, and the target-balance switch gives the EA a "hit $1,000 then coast" architecture: once the goal is reached, the strategy freezes in a profit-preservation posture, letting existing positions run their broker-side SL/TP and the trailing-stop management. The OnTester formula at line 515 reinforces this: growthRate × profitFactor / (1 + maxDD/100), where growthRate = (initialDeposit + profit - InitialBalance) / InitialBalance. The custom metric is tuned to reward strategies that turn the $100 starting target into a large final balance, not strategies that grind for a 5% monthly return.

The ShouldOpenPosition() gate has four conditions before any signal is evaluated: live spread (in points from SYMBOL_SPREAD) must be at or below MaxSpread=3.0, the open position count must be below MaxPositions=3, the time since lastTradeTime must be at least 60 seconds, and the market.isVolatile flag must be true. The 60-second cooldown is a frequency limiter that prevents the EA from firing multiple trades on the same volatility event across consecutive ticks. The 3-point spread cap is unusually tight for gold — most retail XAUUSD spreads sit in the 10–30 point range, so the EA's MaxSpread=3.0 will block entries on the vast majority of retail brokers. The MinVolatility=0.0001 floor in turn rejects only the deadest of sessions; on a 2-digit XAUUSD broker, ATR(14) of 0.0001 in points is roughly $0.001, which is essentially never seen. Combined, the spread cap and the volatility floor together mean the EA will reject the majority of broker conditions even when the signal stack fires.

The TryClose_EX14006, TryClosePartial_EX14006, and TryModify_EX14006 helpers at the bottom of the file follow the standard 3-attempt retry pattern on REQUOTE/TIMEOUT/PRICE_OFF/PRICE_CHANGED (200 ms sleeps for close, 100 ms for modify). They are actually called by the management code — unlike the EX14 cousins, the live close/partial/modify paths in ManagePositions() go through these helpers, not through trade.PositionClose or trade.PositionModify directly. That makes EX14006 a slightly more robust member of the family for live trading: the retry on PRICE_CHANGED matters more for the loss-cut and partial-close paths because those fire on live balance changes, and a transient requote on a fast market can push the position into the cut zone and back out within a tick.

Risk is rated HIGH for three compounding reasons. First, the 10% RiskPerTrade default is two-to-three times the typical EA default, and the growth factor pushes it further on a rising balance. Second, the 30% MaxDailyLoss cap is permissive — most aggressive scalpers in the corpus run with a 5–10% daily cap, and 30% allows for a brutal single-session drawdown. Third, the 5% per-position loss-cut acts as a hard close on positions that should have been left to their broker-side SL, and the 2% per-position partial-close fires on small profits in a way that can chip away at a position's runner potential. The minimum recommended deposit of 100 USD assumes the 0.01-lot micro floor on gold, which most retail brokers allow on cent or micro accounts; a $1,000 account gives the growth factor enough headroom to operate at the 2.0× cap on the standard 10% risk, producing meaningful position sizes without crossing the broker's margin threshold. The strategy's self-shutdown at $1,000 is the natural break-even point for a trader who wants the EA to do the work and then step aside.

Strategy Deep Dive

On every tick the EA pulls 3 bars (or 20 for the MA) from six indicator handles on PERIOD_CURRENT, builds a MarketCondition struct with isTrending/isVolatile/isBullish/isBearish flags plus volatility/momentum/strength scalars, and runs the four-priority signal ladder. The lot size is 10% of balance scaled by a 0.5x-growth-factor capped at 2.0x, then divided by the ATR-anchored stop. The order is sent with sl=1.5ATR (or 2.0ATR when volatile) and tp=2x that. Position management runs the 20-point trailing stop, 50% partial close at 2% balance profit, 5% balance loss hard close, and momentum-reversal close. The 30% daily loss cap and the $1000 target-balance self-shutdown round out the safety stack.

Entry Signal

Entries fire on an exclusive four-priority ladder. Priority 1 buys on an oversold-bounce mean-reversion (RSI<30 with RSI[1]<25 and rising, close at or below BB lower, Stochastic<20 crossing up). Priority 2 sells on the overbought mirror. Priorities 3 and 4 follow the bullish/bearish trend with a fresh MACD cross and RSI momentum in the 30–70 band. Higher-priority signals always win — no signal is fired if a higher one already matched.

Exit Signal

Five exit paths run in parallel: the broker-side SL and TP, the 20-point trailing stop with 10-point step, the 50% partial close at 2% of balance in floating profit, the hard close at 5% of balance in floating loss, and the momentum-reversal close on a profitable position when RSI crosses 70/30 against the trade. The 30% daily loss cap on starting balance blocks new entries, and the EA self-shuts when account balance hits TargetBalance=1000.

Stop Loss

SL is ATR-anchored and sent to the broker: sl = price - 1.5ATR in normal volatility, sl = price - 2.0ATR when market.isVolatile=true. A 5%-of-balance floating-loss hard close in ManagePositions acts as a second kill that overrides the broker SL when the position is bleeding relative to account size.

Take Profit

TP is ATR-anchored at TakeProfitFactor × the SL distance: tp = price + 2.01.5ATR in normal conditions and tp = price + 2.02.0ATR in volatile. The 50% partial close at 2%-of-balance floating profit also fires as a soft TP, banking half the position before the broker TP is reached.

Best For

Best paired with a low-spread broker on XAUUSD M5 with a $100 starting balance, on a cent or micro account where 0.01-lot micro trading is allowed and the 10% risk-per-trade default translates to a manageable dollar risk. The 3-point spread cap means the EA needs a raw-spread broker that holds gold spreads at 3 points or below — most retail XAUUSD feeds sit at 10–30 points, so the strategy effectively requires an institutional-grade ECN feed. The aggressive lot-scaling growth factor rewards sustained winning streaks on rising balances, so the EA pairs best with a trader who can size the 2.0x cap to their broker's max-lot limit before the $1,000 target balance is reached.

Strategy Logic

Pipsgrowth EX14006 Scalper — Strategy Logic Analysis (from .mq5 source)

Family: Scalper Magic: 22214006 Version: 2.00

BRIEF: Aggressive scalper using multi-indicator confluence (RSI, MA, ATR, Bollinger Bands, MACD, Stochastic) with risk-based position sizing, trailing stops, partial profit taking, and daily loss protection

INDICATOR STACK:

  • Standard MT5 indicators

KEY FUNCTIONS:

  • UpdateIndicators()
  • NormalizePrice()
  • NormalizeLot()
  • ShouldOpenPosition()
  • CheckEntrySignals()
  • ExecuteBuy()
  • ExecuteSell()
  • CalculateLotSize()
  • ManagePositions()
  • TrailingStop()
  • CountPositions()
  • IsDailyLossLimitReached()
  • ...and 3 more

INTERNAL CONSTANTS (0 total):

INPUT PARAMETERS (16 total across 6 groups):

  • [=== Identity ===] MagicNumber = 22214006 // Magic Number
  • [=== Identity ===] InpTradeComment = "Psgrowth.com Expert_14006" // Trade Comment
  • [=== Capital ===] InitialBalance = 100.0 // Initial Balance Target
  • [=== Capital ===] TargetBalance = 1000.0 // Target Balance
  • [=== Risk ===] RiskPerTrade = 10.0 // Risk per trade (%)
  • [=== Risk ===] MaxDailyLoss = 30.0 // Max daily loss (%)
  • [=== Risk ===] MaxPositions = 3 // Maximum concurrent positions
  • [=== Risk ===] TakeProfitFactor = 2.0 // TP as factor of SL
  • [=== Manage ===] UseTrailingStop = true // Use trailing stop
  • [=== Manage ===] TrailingStart = 20.0 // Trailing start (points)
  • [=== Manage ===] TrailingStep = 10.0 // Trailing step (points)
  • [=== Signal ===] RSIPeriod = 14 // RSI Period
  • [=== Signal ===] MAPeriod = 20 // MA Period
  • [=== Signal ===] ATRPeriod = 14 // ATR Period
  • [=== Signal ===] MinVolatility = 0.0001 // Minimum volatility
  • [=== Filter ===] MaxSpread = 3.0 // Maximum spread (points)
Pseudocode
// Pipsgrowth EX14006 Scalper — Execution Flow (from source analysis)
// Family: Scalper
// Aggressive scalper using multi-indicator confluence (RSI, MA, ATR, Bollinger Bands, MACD, Stochastic) with risk-based position sizing, trailing stops, partial profit taking, and daily loss protection

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

Optimized Brokers:
ExnessIC Markets
Optimized Symbols:
XAUUSD
Optimized Timeframes:
M5H1

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 from the Navigator onto any chart (M1 or M5 recommended)
  7. 7In the EA dialog, enable Allow Algo Trading and set your lot size
  8. 8Click OK — the EA will begin trading automatically

EA Parameters

ParameterDefaultDescription
MagicNumber22214006Magic Number
InpTradeComment"Psgrowth.com Expert_14006"Trade Comment
InitialBalance100.0Initial Balance Target
TargetBalance1000.0Target Balance
RiskPerTrade10.0Risk per trade (%)
MaxDailyLoss30.0Max daily loss (%)
MaxPositions3Maximum concurrent positions
TakeProfitFactor2.0TP as factor of SL
UseTrailingStoptrueUse trailing stop
TrailingStart20.0Trailing start (points)
TrailingStep10.0Trailing step (points)
RSIPeriod14RSI Period
MAPeriod20MA Period
ATRPeriod14ATR Period
MinVolatility0.0001Minimum volatility
MaxSpread3.0Maximum spread (points)
Source Code (.mq5)Open Source
Pipsgrowth_com_EX14006.mq5
#property copyright "Pipsgrowth.com"
#property link      "https://pipsgrowth.com"
#property version   "2.00"
#property strict
#property description "Pipsgrowth.com EX14006 AggressiveScalperEA — multi-indicator aggressive scalper, full 12-layer stack."

#include <Trade\Trade.mqh>
#include <Trade\PositionInfo.mqh>
#include <Trade\AccountInfo.mqh>

//--- Input parameters
input group "=== Identity ==="
input int      MagicNumber = 22214006;          // Magic Number
input string   InpTradeComment = "Psgrowth.com Expert_14006"; // Trade Comment

input group "=== Capital ==="
input double   InitialBalance = 100.0;        // Initial Balance Target
input double   TargetBalance = 1000.0;        // Target Balance

input group "=== Risk ==="
input double   RiskPerTrade = 10.0;           // Risk per trade (%)
input double   MaxDailyLoss = 30.0;           // Max daily loss (%)
input int      MaxPositions = 3;              // Maximum concurrent positions
input double   TakeProfitFactor = 2.0;        // TP as factor of SL

input group "=== Manage ==="
input bool     UseTrailingStop = true;        // Use trailing stop
input double   TrailingStart = 20.0;          // Trailing start (points)
input double   TrailingStep = 10.0;           // Trailing step (points)

input group "=== Signal ==="
input int      RSIPeriod = 14;                // RSI Period
input int      MAPeriod = 20;                 // MA Period
input int      ATRPeriod = 14;                // ATR Period
input double   MinVolatility = 0.0001;        // Minimum volatility

input group "=== Filter ==="
input double   MaxSpread = 3.0;               // Maximum spread (points)

//--- Global variables
CTrade trade;
CPositionInfo position;
CAccountInfo account;

double dailyStartBalance;
datetime lastTradeTime;
int handleRSI, handleMA, handleATR, handleBB, handleMACD, handleStoch;
double rsiBuffer[], maBuffer[], atrBuffer[], bbUpper[], bbLower[], bbMiddle[];
double macdMain[], macdSignal[], stochMain[], stochSignal[];

struct MarketCondition {
    bool isTrending;
    bool isVolatile;
    bool isBullish;
    bool isBearish;
    double strength;
    double volatility;
    double momentum;
};

Full source code available on download

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

Tags:ex14006scalperpipsgrowthfreemt5xauusd

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_EX14006.mq5
File Size23.5 KB
Versionv2.00
PlatformMetaTrader 5
File Type.mq5 Source
StrategyScalping
Risk LevelHigh Risk
Timeframes
M5H1
Currency Pairs
XAUUSD
Min. Deposit$100