Pipsgrowth EX16036 Trend
MT5 Expert Advisor (Open Source) · XAUUSD · M1, H1
Pipsgrowth.com EX16036 EX_X3_XAUUSD_pro — dual-entry dual-confirm XAU Pro scalper, full 12-layer stack.
Overview
Pipsgrowth EX16036 Trend — written into the EX16xxx 'Trend' family under the source-header name 'EX_X3_XAUUSD_pro' — is a dual-vote XAUUSD M1 scalper with magic 22216036 stamped on every order so it can co-exist with other EAs on the same account. The .mq5 ships 66 inputs across 16 input groups, 48 functions, and 9 pre-declared indicator handles in OnInit — eight created eagerly up front, with the ninth (hATR) lazy-loaded inside GetATRPoints() only when ATR-based SL/TP is enabled. The source header claims a 12-layer architecture (REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester); what is actually wired in the code is 10 of those — the OnTester function is described in the header but absent from the file, and the CAPITAL CAP layer (a balance or equity drawdown stop) is not implemented anywhere.
The strategy's structural signature is a dual-entry dual-confirm vote solved across a sliding bar window. The user picks two of five pluggable entry types via the InpEntry1Type and InpEntry2Type enums — by default SIG_MA_CROSS (fast EMA crossing slow EMA) and SIG_RSI_50 (RSI crossing the 50 midline) — and two confirmation gates that have to fire alongside. ConfirmADX() requires ADX(14) >= InpADXMin (18 default) and the matching +DI > -DI (or -DI > +DI for shorts). ConfirmMTFTrend() pulls a 200-period EMA from InpMTF_TF — code value 4, mapped to PERIOD_M30 by MapTimeframeInt() — and demands price sit on the correct side of that EMA. SolveWindow() walks bars 1..InpEntryWindowBars (6 default) and runs a combinatorial search across all four signals to find the bar combination whose max shift is smallest, i.e. the 'freshest' simultaneous alignment — and returns that bar to TryEntries() as the anchor for the next entry. Two strict toggles — InpRequireEntriesSameBar and InpRequireConfSameBar — force the matching pair to fire on a single bar instead of allowing them to be spread across the window. The optional InpUseBarQualityFilter reads the body/range ratio of the anchor bar and rejects entries where the body is less than InpMinBodyToRange=0.2 of the candle range.
Trade management and risk split across four layers. CalcSLTP() defaults to 300/600 points (30/60 pips on 5-digit XAUUSD) — a static 1:2 R:R — or, when InpUseATRforSLTP is true, to ATR(14) × InpATR_SL_Mult(3.0) for SL and × InpATR_TP_Mult(6.0) for TP. SendOrderAdaptive() wraps OrderSend in a four-attempt loop that widens deviation by 3 points per retry up to InpMaxAdaptiveDeviation=20, sleeping 80 ms × retry between attempts. ApplyDynamicLockProfitToPosition() runs every tick via MaintainPositions(), measures how many points price has moved in profit, divides by InpLockProfitEveryXPoints(150) to compute step count, and proposes a new SL of entry ± (steps*150 - InpLockMinusYPointsBuffer=20) points. The ratchet only tightens — never widens — and refuses to act when the proposed SL would land inside the broker's SYMBOL_TRADE_FREEZE_LEVEL.
The 'no-trade' gate CanPlaceNew() stacks six independent pre-entry checks: the OnTradeTransaction-driven g_tradePauseUntil flag (set when PauseOnConsecutiveLosses fires at 3 losses / 60 min, or PauseOnLossAmount fires at 100 USD / 60 min — both disabled by default), a one-entry-per-bar latch keyed off iTime(_Symbol,PERIOD_CURRENT,0), the IsWithinSessions() window check (London 7-17 OR New York 13-22), the dynamic-spread check, the CountOpenPositionsAll() >= MaxOpenTrades=5 cap, and a tick-activity floor (InpMinTicksPerMin=20 blocks entries when the past 60 seconds have fewer than 20 ticks, designed to keep the EA out of dead-market windows). The dynamic-spread check itself is built on a 200-tick ring buffer of SYMBOL_SPREAD values, with CheckSpreadOK() comparing current spread against median + InpSpreadMADMult(3.0) × MAD, with an optional absolute cap InpSpreadCapAbsPoints=0 (off).
'Scaling' uses a non-standard same-direction rule. The first ticket is tagged 'Initial BUY' or 'Initial SELL'; subsequent same-direction entries are tagged 'Add#N BUY' or 'Add#N SELL' with separate per-side counters g_addCountBuy / g_addCountSell. AllowOnlyProfitableAdditions=true and MinProfitPerTradeToAdd=5.0 mean a new add only fires if every open position on the same side is at least 5 points in profit. A 20-second per-direction cooldown (InpCooldownSecondsDir) blocks back-to-back same-side entries. There is no reverse-signal exit, no time-based close, no daily-loss cap, no balance-drawdown cap, and no equity-curve kill switch — positions only close via the static SL, the static TP, or the DLP ratchet. OnTradeTransaction listens for DEAL_ENTRY_OUT events, accumulates g_lossStreakCount and g_lossStreakAmt on losing exits, resets both to 0 on the next winning close, and pushes g_tradePauseUntil forward when either pause trigger trips.
Three CTrade-based retry helpers at the bottom of the file — TryClose_EX16036, TryClosePartial_EX16036, TryModify_EX16036 — are defined with a 3-attempt REQUOTE/TIMEOUT/PRICE_OFF/PRICE_CHANGED loop but never wired into the live OnTick path. The actual close calls go through ClosePositionByTicket and the modify calls go through ModifyPositionSLTP, both of which have their own single-attempt paths. ICMarkets is named in the OnInit log message but the EA itself is broker-agnostic — it only requires that the broker report SYMBOL_SPREAD, SYMBOL_TRADE_FREEZE_LEVEL, SYMBOL_VOLUME_STEP, SYMBOL_FILLING_MODE bits, and that point size matches _Point. The MagicNumber, InpTradeComment, InpSignalsTF, InpMTF_TF, and InpMAPrice inputs are tagged '/no opt', meaning the MT5 strategy tester optimizer will leave them alone even when the rest of the 61 inputs are ranged.
Strategy Deep Dive
SolveWindow() walks the past 1..InpEntryWindowBars bars evaluating the two entry signal types and the two confirmation gates, then returns the bar combination with the smallest max-shift where all four fire in the same direction. CanPlaceNew() stacks six pre-entry checks — pause-until timestamp, one-entry-per-bar, sessions, dynamic spread, max-open, and tick activity — before any order fires, and a 20-second per-direction cooldown blocks back-to-back same-side entries. After every send, SendOrderAdaptive() retries up to 4 times widening deviation by 3 points per attempt up to InpMaxAdaptiveDeviation=20. MaintainPositions() runs every tick and walks every owned ticket through ApplyDynamicLockProfitToPosition(), which steps the SL toward profit in 150-point increments with a 20-point buffer and never widens.
The EA fires a buy when the fast EMA (InpMAFastPeriod=20) crosses above the slow EMA (InpMASlowPeriod=50) AND the 14-period RSI crosses above the 50 midline, both confirmed by ADX >= 18 with +DI > -DI and price above the M30 200-EMA. Sell is the mirror: EMA cross down, RSI crosses below 50, ADX >= 18 with -DI > +DI, price below the M30 200-EMA. SolveWindow() picks the bar combination that aligns all four signals with the smallest max-shift inside InpEntryWindowBars (6 default).
Positions exit via the static 300/600-point SL/TP, or via the Dynamic Lock Profit ratchet which tightens the SL every 150 points of favorable move with a 20-point buffer behind each step. There is no reverse-signal exit, no time-based close, no daily-loss cap, and no balance-drawdown cap. The same-direction add gate also acts as a brake: any new entry requires every open same-side position to be at least 5 points in profit.
Initial SL is fixed at InpSL_Points=300 (30 pips on 5-digit XAU) or, when InpUseATRforSLTP=true, ATR(14) × 3.0. The Dynamic Lock Profit ratchet then tightens the SL every 150 points of favorable move, with a 20-point buffer to avoid being shaken out by spread, and never widens the SL once placed.
TP is fixed at InpTP_Points=600 (60 pips) by default — a static 1:2 R:R against the 300-point SL — or ATR(14) × 6.0 when ATR-based SL/TP is enabled. There is no partial close and no basket TP; positions only close on the static TP, the static SL, or via the DLP ratchet.
Best on an ECN or RAW-spread broker with consistent tight spreads — the dynamic-spread gate is built around 200-tick median+MAD and the static 1:2 R:R doesn't leave room for spread creep. Minimum recommended balance: $100 (M1, 0.10 lot, 5 max concurrent, 30-pip SL), $500+ if you want headroom for a 5-position cluster to ride through drawdown. Run during the configured London 7-17 and New York 13-22 windows; outside them the EA is hard-blocked and the 20-tick-per-minute activity floor keeps it out of dead pre-London and post-NY drift.
Strategy Logic
Pipsgrowth EX16036 Trend — Strategy Logic Analysis (from .mq5 source)
Family: Trend
Magic: 22216036
Version: 2.00
BRIEF:
XAU M1 scalper Pro using dual-entry signals (EMA cross + RSI 50-level) with dual confirmations (ADX +DI/-DI and MTF 200-EMA align) within an X-bar window. Dynamic Lock Profit, microstructure filters, cooldown, bar-quality filter, pause guards. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
DirStr()TickSize()NormalizePriceToTick()NormalizeVol()Ask()Bid()IsWithinSessions()CurrentSpreadPts()SpreadPush()MedianOf()MADOf()CheckSpreadOK()- ...and 37 more
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (66 total across 16 groups):
- [===
CORE===]MagicNumber=22216036// Magic number (no opt) - [===
CORE===]InpTradeComment= "Psgrowth.com Expert_16036" // Trade comment (no opt) - [===
DYNAMICLOCKPROFIT===]InpEnableDynamicLockProfit=true// Enable Dynamic LockProfit(bool) - [===
DYNAMICLOCKPROFIT===]InpLockProfitEveryXPoints= 150 //DLPstep in points (50,10,400) - [===
DYNAMICLOCKPROFIT===]InpLockMinusYPointsBuffer= 20 //DLPbuffer below step (5,5,60) - [===
INITIALvsADDITIONAL===]MaxOpenTrades= 5 // Max concurrent trades (1,1,10) - [===
INITIALvsADDITIONAL===]AllowOnlyProfitableAdditions=true// Allow adds only if all profitable (bool) - [===
INITIALvsADDITIONAL===]MinProfitPerTradeToAdd=5.0// Min pts per trade to permit add (2.0,1.0,30.0) - [===
PAUSEGUARDS===]PauseOnConsecutiveLosses=false// Enable pause on loss streak (bool) - [===
PAUSEGUARDS===]PauseConsecutiveLossesCount= 3 // Loss streak trigger count (2,1,6) - [===
PAUSEGUARDS===]PauseConsecutiveLossesMinutes= 60 // Pause minutes after streak (15,15,240) - [===
PAUSEGUARDS===]PauseOnLossAmount=false// Enable pause on loss amount (bool) - [===
PAUSEGUARDS===]PauseLossAmount=100.0// Loss amount trigger (50.0,25.0,1000.0) - [===
PAUSEGUARDS===]PauseLossAmountMinutes= 60 // Pause minutes after amount (15,15,240) - [===
TRADE&RISK===]InpFixedLot=0.10// Fixed lot size (0.01,0.01,1.00) - [===
TRADE&RISK===]InpUseATRforSLTP=false// UseATR-based SL/TP(bool) - [===
TRADE&RISK===]InpATRPeriod= 14 //ATRperiod (5,1,50) - [===
TRADE&RISK===]InpATR_SL_Mult=3.0//ATRSL multiplier (1.0,0.5,6.0) - [===
TRADE&RISK===]InpATR_TP_Mult=6.0//ATRTP multiplier (2.0,0.5,12.0) - [===
TRADE&RISK===]InpSL_Points= 300 // Static SL points (100,25,1000) - [===
TRADE&RISK===]InpTP_Points= 600 // Static TP points (200,25,2000) - [===
TRADE&RISK===]InpSlippagePoints= 5 // Initial slippage (1,1,15) - [===
TRADE&RISK===]InpMaxAdaptiveDeviation= 20 // Max adaptive deviation (5,5,60) - [===
TRADE&RISK===]InpOneEntryPerBar=true// Restrict to one entry per bar (bool) - [===
TRADE&RISK===]InpCooldownSecondsDir= 20 // Cooldown seconds per direction (5,5,120) - [===
SPREAD&SESSIONS===]InpUseDynamicSpreadCap=true// Enable dynamic spread cap (bool) - [===
SPREAD&SESSIONS===]InpSpreadLookbackTicks= 200 // Spread lookback ticks (50,25,400) - [===
SPREAD&SESSIONS===]InpSpreadMADMult=3.0//MADmultiplier (1.5,0.5,5.0) - [===
SPREAD&SESSIONS===]InpSpreadCapAbsPoints= 0 // Absolute spread cap pts 0=off (20,5,120) - [===
SPREAD&SESSIONS===]InpUseSessions=true// Restrict by sessions (bool) - [===
SPREAD&SESSIONS===]InpSession1StartHH= 7 // Session1 start hour (0,1,23) - [===
SPREAD&SESSIONS===]InpSession1EndHH= 17 // Session1 end hour (1,1,24) - [===
SPREAD&SESSIONS===]InpSession2StartHH= 13 // Session2 start hour (0,1,23) - [===
SPREAD&SESSIONS===]InpSession2EndHH= 22 // Session2 end hour (1,1,24) - [===
SPREAD&SESSIONS===]InpMinTicksPerMin= 20 // Min ticks per minute (0,5,120) - [===
SIGNALSWINDOW===]InpEntryWindowBars= 6 // Signal window bars (2,1,12) - [===
SIGNALSWINDOW===]InpRequireEntriesSameBar=false// Entries must be same bar (bool) - [===
SIGNALSWINDOW===]InpRequireConfSameBar=false// Confirms must be same bar (bool) - [===
SIGNALSWINDOW===]InpSignalsTF= 1 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Signals timeframe (no opt) - [===
ENTRIESSELECT===]InpEntry1Type=SIG_MA_CROSS// Primary entry signal (enum) - [===
ENTRIESSELECT===]InpEntry2Type=SIG_RSI_50// Secondary entry signal (enum) - [===
CONFIRMATIONSSELECT===]InpUseADXConfirm=true// EnableADXconfirmation (bool) - [===
CONFIRMATIONSSELECT===]InpADXPeriod= 14 //ADXperiod (5,1,40) - [===
CONFIRMATIONSSELECT===]InpADXMin=18.0// MinADXthreshold (10.0,1.0,40.0) - [===
CONFIRMATIONSSELECT===]InpUseMTFTrendConfirm=true// EnableMTFEMAtrend filter (bool) - [===
CONFIRMATIONSSELECT===]InpMTF_TF= 4 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //MTFtrend timeframe (enum) - [===
CONFIRMATIONSSELECT===]InpMTF_EMAPeriod= 200 //MTFEMAperiod (50,25,400) - [=== MA
SETTINGS===]InpMAFastPeriod= 20 // Fast MA period (5,1,60) - [=== MA
SETTINGS===]InpMASlowPeriod= 50 // Slow MA period (20,5,200) - [=== MA
SETTINGS===]InpMAMethod=MODE_EMA// MA method (enum) - [=== MA
SETTINGS===]InpMAPrice= 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // Applied price (enum) - [===
RSISETTINGS===]InpRSIPeriod= 14 //RSIperiod (5,1,40) - [===
MACDSETTINGS===]InpMACD_FastEMA= 12 //MACDfastEMA(5,1,20) - [===
MACDSETTINGS===]InpMACD_SlowEMA= 26 //MACDslowEMA(15,1,60) - [===
MACDSETTINGS===]InpMACD_Signal= 9 //MACDsignal (3,1,18) - [===
STOCHSETTINGS===]InpStoch_K= 14 // Stochastic %K(5,1,30) - [===
STOCHSETTINGS===]InpStoch_D= 3 // Stochastic %D(2,1,10) - [===
STOCHSETTINGS===]InpStoch_Slowing= 3 // StochasticSlowing(1,1,10) - [===
CCISETTINGS===]InpCCIPeriod= 20 //CCIperiod (10,2,60) - [===
CCISETTINGS===]InpCCI_BuyLevel=100.0//CCIbuylevel(50.0,10.0,250.0) - [===
CCISETTINGS===]InpCCI_SellLevel= -100.0//CCIselllevel(-250.0,10.0,-50.0) - [===
BARQUALITYFILTER(optional) ===]InpUseBarQualityFilter=false// Enable bar quality filter (bool) - [===
BARQUALITYFILTER(optional) ===]InpMinBodyToRange=0.2// Min body/range ratio (0.10,0.05,0.80) - [===
BARQUALITYFILTER(optional) ===]InpCheckBarShift= 1 // Bar shift to check quality (1,1,InpEntryWindowBars) - [===
DEBUG===]InpDebugStochCounts=false// Debug: count stoch crosses (bool) - [===
DEBUG===]InpDebugSignalLogs=false// Debug: verbose window solver logs (bool)
// Pipsgrowth EX16036 Trend — Execution Flow (from source analysis)
// Family: Trend
// XAU M1 scalper Pro using dual-entry signals (EMA cross + RSI 50-level) with dual confirmations (ADX +DI/-DI and MTF 200-EMA align) within an X-bar window. Dynamic Lock Profit, microstructure filters, cooldown, bar-quality filter, pause guards. 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 H4 or Daily chart for best results
- 7Configure EMA periods, ADX threshold, and lot size in the dialog
- 8Enable Allow Algo Trading and click OK
EA Parameters
| Parameter | Default | Description |
|---|---|---|
| MagicNumber | 22216036 | Magic number (no opt) |
| InpTradeComment | "Psgrowth.com Expert_16036" | Trade comment (no opt) |
| InpEnableDynamicLockProfit | true | Enable Dynamic Lock Profit (bool) |
| InpLockProfitEveryXPoints | 150 | DLP step in points (50,10,400) |
| InpLockMinusYPointsBuffer | 20 | DLP buffer below step (5,5,60) |
| MaxOpenTrades | 5 | Max concurrent trades (1,1,10) |
| AllowOnlyProfitableAdditions | true | Allow adds only if all profitable (bool) |
| MinProfitPerTradeToAdd | 5.0 | Min pts per trade to permit add (2.0,1.0,30.0) |
| PauseOnConsecutiveLosses | false | Enable pause on loss streak (bool) |
| PauseConsecutiveLossesCount | 3 | Loss streak trigger count (2,1,6) |
| PauseConsecutiveLossesMinutes | 60 | Pause minutes after streak (15,15,240) |
| PauseOnLossAmount | false | Enable pause on loss amount (bool) |
| PauseLossAmount | 100.0 | Loss amount trigger (50.0,25.0,1000.0) |
| PauseLossAmountMinutes | 60 | Pause minutes after amount (15,15,240) |
| InpFixedLot | 0.10 | Fixed lot size (0.01,0.01,1.00) |
| InpUseATRforSLTP | false | Use ATR-based SL/TP (bool) |
| InpATRPeriod | 14 | ATR period (5,1,50) |
| InpATR_SL_Mult | 3.0 | ATR SL multiplier (1.0,0.5,6.0) |
| InpATR_TP_Mult | 6.0 | ATR TP multiplier (2.0,0.5,12.0) |
| InpSL_Points | 300 | Static SL points (100,25,1000) |
| InpTP_Points | 600 | Static TP points (200,25,2000) |
| InpSlippagePoints | 5 | Initial slippage (1,1,15) |
| InpMaxAdaptiveDeviation | 20 | Max adaptive deviation (5,5,60) |
| InpOneEntryPerBar | true | Restrict to one entry per bar (bool) |
| InpCooldownSecondsDir | 20 | Cooldown seconds per direction (5,5,120) |
| InpUseDynamicSpreadCap | true | Enable dynamic spread cap (bool) |
| InpSpreadLookbackTicks | 200 | Spread lookback ticks (50,25,400) |
| InpSpreadMADMult | 3.0 | MAD multiplier (1.5,0.5,5.0) |
| InpSpreadCapAbsPoints | 0 | Absolute spread cap pts 0=off (20,5,120) |
| InpUseSessions | true | Restrict by sessions (bool) |
| InpSession1StartHH | 7 | Session1 start hour (0,1,23) |
| InpSession1EndHH | 17 | Session1 end hour (1,1,24) |
| InpSession2StartHH | 13 | Session2 start hour (0,1,23) |
| InpSession2EndHH | 22 | Session2 end hour (1,1,24) |
| InpMinTicksPerMin | 20 | Min ticks per minute (0,5,120) |
| InpEntryWindowBars | 6 | Signal window bars (2,1,12) |
| InpRequireEntriesSameBar | false | Entries must be same bar (bool) |
| InpRequireConfSameBar | false | Confirms must be same bar (bool) |
| InpSignalsTF | 1 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Signals timeframe (no opt) |
| InpEntry1Type | SIG_MA_CROSS | Primary entry signal (enum) |
| InpEntry2Type | SIG_RSI_50 | Secondary entry signal (enum) |
| InpUseADXConfirm | true | Enable ADX confirmation (bool) |
| InpADXPeriod | 14 | ADX period (5,1,40) |
| InpADXMin | 18.0 | Min ADX threshold (10.0,1.0,40.0) |
| InpUseMTFTrendConfirm | true | Enable MTF EMA trend filter (bool) |
| InpMTF_TF | 4 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // MTF trend timeframe (enum) |
| InpMTF_EMAPeriod | 200 | MTF EMA period (50,25,400) |
| InpMAFastPeriod | 20 | Fast MA period (5,1,60) |
| InpMASlowPeriod | 50 | Slow MA period (20,5,200) |
| InpMAMethod | MODE_EMA | MA method (enum) |
| InpMAPrice | 1 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // Applied price (enum) |
| InpRSIPeriod | 14 | RSI period (5,1,40) |
| InpMACD_FastEMA | 12 | MACD fast EMA (5,1,20) |
| InpMACD_SlowEMA | 26 | MACD slow EMA (15,1,60) |
| InpMACD_Signal | 9 | MACD signal (3,1,18) |
| InpStoch_K | 14 | Stochastic %K (5,1,30) |
| InpStoch_D | 3 | Stochastic %D (2,1,10) |
| InpStoch_Slowing | 3 | Stochastic Slowing (1,1,10) |
| InpCCIPeriod | 20 | CCI period (10,2,60) |
| InpCCI_BuyLevel | 100.0 | CCI buy level (50.0,10.0,250.0) |
| InpCCI_SellLevel | -100.0 | CCI sell level (-250.0,10.0,-50.0) |
| InpUseBarQualityFilter | false | Enable bar quality filter (bool) |
| InpMinBodyToRange | 0.2 | Min body/range ratio (0.10,0.05,0.80) |
| InpCheckBarShift | 1 | Bar shift to check quality (1,1,InpEntryWindowBars) |
| InpDebugStochCounts | false | Debug: count stoch crosses (bool) |
| InpDebugSignalLogs | false | Debug: verbose window solver logs (bool) |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX16036 EX_X3_XAUUSD_pro — dual-entry dual-confirm XAU Pro scalper, full 12-layer stack."
#include <Trade\Trade.mqh>
//===================================================================
// ⇩ INPUTS ⇩
//===================================================================
//------------------------------ CORE --------------------------------
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_InpSignalsTF = PERIOD_H1;
ENUM_TIMEFRAMES g_InpMTF_TF = PERIOD_H1;
ENUM_APPLIED_PRICE g_InpMAPrice = PRICE_CLOSE;
input group "=== CORE ==="
input int MagicNumber = 22216036; // Magic number (no opt)
input string InpTradeComment = "Psgrowth.com Expert_16036"; // Trade comment (no opt)
//------------------ DYNAMIC LOCK PROFIT (Ratchet) -------------------
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;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 Trend Following strategy EAs from our library
Pipsgrowth EX16080 Trend
Pipsgrowth.com EX16080 EURUSDTrendFollower — triple-EMA H4 trend follower, full 12-layer stack.
Pipsgrowth EX16081 Trend
Pipsgrowth.com EX16081 GoldTrendEA — XAUUSD H4 EMA cross with Fib targets, full 12-layer stack.
Pipsgrowth EX16033 Trend
Pipsgrowth.com EX16033 EA_Price_Action — price-action grid scalper, full 12-layer stack.
Community
Educational purposes only. Do NOT use with real money. Test on demo accounts only.