Pipsgrowth EX01003 Adaptive
MT5 Expert Advisor (Open Source) · XAUUSD · M5, H1
Pipsgrowth.com EX01003 AdaptiveForexMaster FillingMode Fixed — multi-adaptive confirmation EA, full 12-layer stack, configurable timeframe, trailing/BE/profit-lock toggles, pyramid gate, spread filter, new-bar gate.
Overview
Pipsgrowth EX01003 Adaptive sits at the heavier end of the Adaptive family: an 87-input, 62-function MQL5 implementation that fuses a five-indicator confirmation stack, a regime classifier, multi-timeframe alignment, and a self-tuning sensitivity loop on top of a vanilla indicator suite. The point of the design is to refuse trades that look attractive on one timeframe but disagree on another, and to keep changing the rules when the character of the market changes. Magic 22201003, M5 default chart, XAUUSD-compatible input set, $100 minimum deposit as declared on the broker-facing description.
The signal engine in GetMarketSignalWithRegime() works off closed-bar prices (shift 1) so the EA never repaints. Five indicators feed a regime-aware scoring system. The Adaptive Moving Average — built from iAMA with period 14, fast EMA 2, slow EMA 30 — produces the primary crossover trigger. RSI(14) and Stochastic(14,3,3) contribute oscillator votes, and MACD(12,26,9) adds a trend vote. ATR(14) is the volatility backbone: it sizes stops, scales positions, sets the partial-close target, and feeds the trailing distance. The five indicators are also cross-correlated through CalculateIndicatorCorrelations() and HasSufficientCorrelation(). A signal is rejected if the indicators do not all broadly agree (CorrelationThreshold 0.7 by default). That single gate eliminates most of the chop-trade noise that pure crossover systems suffer from.
The regime classifier in DetectMarketRegime() reads 100 bars of closes and splits the market into five states: REGIME_TRENDING_UP, REGIME_TRENDING_DOWN, REGIME_RANGING, REGIME_VOLATILE, REGIME_QUIET. Trend strength is computed with three blended methods and gated against TrendThreshold = 0.6 (range 0.5–1.0). Volatility is read as a ratio against a baseline and gated against VolatilityThreshold = 1.5. The classifier updates every 15 minutes rather than every tick, which keeps the regime sticky enough to avoid whipsaw classification but reactive enough to catch real turns. The active regime changes the weights in the buy/sell score: in trending markets AMA, MACD, and the trend signal carry 3.0, 2.5, and 2.0 weights respectively; in ranging markets the weights flip and RSI gets 3.0 with Stochastic at 2.5. A combined buy or sell score must reach 4.0 and exceed the opposing side by 20% before a trade is dispatched. That threshold is what signalThreshold = 4.0 enforces in code.
Above the entry layer sits the multi-timeframe confirmation system. UpdateMultiTimeframeAnalysis() runs the same AMA and MACD on a ConfirmationTimeframe (H4 by default — input index 8) and a FilterTimeframe (D1 by default — input index 9). IsMultiTimeframeAligned() then refuses a long entry if the H4 trend direction is negative, and refuses a short entry if it is positive. When RequireAllTimeframesAlign = true, the D1 filter is also enforced. HullTimeframe = 8 (H4) plus HullPeriod = 21 gives the third independent confirmation: a custom Hull MA built from 2×LWMA(n/2) − LWMA(n), with slope, price-vs-Hull, and momentum blended into a single trend-direction reading. IsHullConfirmationValid() drops any entry where the Hull direction disagrees with the entry side, and RequireHullAlignment = true makes that gate mandatory by default. By the time a trade is fired, it has cleared three different timeframes, five indicators, a correlation test, a regime filter, a session filter, a spread filter, a news filter, a market-quality check, a pyramid gate, a max-open-position cap, a daily-trade cap, a daily-loss cap, a weekly-loss cap, an equity-protection floor, and a capital-cap and capital-floor. That is the meaning of the 12-layer stack label that the source header advertises.
Risk control starts with CalculateLotSize(). Effective capital is AccountInfoDouble(ACCOUNT_EQUITY), capped at InpCapAmount (default 0 = disabled) and floored at InpCapFloor (default 100.0). The risk amount is capital × RiskPercent (default 1.0% per trade), then converted to lots using the actual stop distance in points and SYMBOL_TRADE_TICK_VALUE. The hard ceiling is InpMaxLot = 100.0. Volatility regime further scales position size: LowVolatilityMultiplier = 0.7, HighVolatilityMultiplier = 0.4. So a 1% risk on a high-vol day actually risks closer to 0.4%. The minimum recommended deposit in the description is $100, and with 1% per trade the natural lot size is well below any broker's SYMBOL_VOLUME_MIN issues on a standard account.
Position management runs every tick inside UpdatePositionManagement() / ProcessAdvancedPositionManagement(). The five stages, in priority order, are: (1) opposite-signal exit — any open position is closed if GetMarketSignalWithRegime() flips to the other side; (2) partial close at PartialCloseTarget = 1.0 ATR of profit, closing PartialClosePercent = 50% of the position; (3) break-even move at BreakEvenTrigger = 1.0 ATR of profit, lifting the stop to entry plus spread; (4) advanced trailing at TrailingATRMultiplier = 1.5 ATR distance, which only kicks in after the break-even move; (5) time-based exit at MaxTradeHours = 24. On top of that, the InpEnableProfitLock system with ProfitLockIncrement = 10.0 and ProfitLockStep = 3.0 ratchets the stop up in 10-point increments, keeping a 3-point trail behind the highest locked level.
Scaling is opt-in via UsePositionScaling. When enabled, additional positions in the same direction are added after the original trade is at least MinimumProfitATR = 1.0 ATR in profit, capped at MaxAdditionalPositions = 3, each at ScalingLotMultiplier = 0.8 of the previous lot. The gate is AllowScalingOnlyInTrend = true by default, so the EA refuses to scale in a ranging regime. A hard 22:00 server-time close (CloseAdditionalTradesHour) clears all scaled-in positions regardless of PnL.
The no-trade gate is just as strict. IsSafeToTrade() checks the capital cap and floor, the equity-protection ratio (MinEquityPercent = 80.0), the realized daily PnL (MaxDailyLossPercent = 3.0), the realized weekly PnL (InpMaxWeeklyLossPct = 8.0), the InpMaxConsecLosses = 3 counter with InpCooldownMin = 30 cooldown, the global InpMaxDDPct = 20.0 kill switch, the manual InpKillSwitch toggle, and the dry-run InpDryRun flag. The session gate runs in GMT (auto-detected via weekend-gap detection if InpServerGMTOffset = 0): London 7–16, NY 12–21, and Asia is refused when InpAvoidAsia = true (default). The spread gate uses InpMaxSpread = 50 points plus an adaptive MaxSpreadMultiplier = 2.0 × 20-bar moving average. The liquidity gate rejects bars with iVolume below MinLiquidityVolume = 100.
In backtest on M5 XAUUSD, expect a low-frequency cadence — five trades a day is the hard cap, and the regime + correlation filters cut that further on most days. Most weeks will print zero or one trades. Curve shape is determined less by win rate and more by the quality of the rare entries that pass every layer. The trade-off is clear: the EA sacrifices trade count for signal purity. A user who wants more activity should lower TrendThreshold toward 0.5, disable RequireHullAlignment, or set RequireAllTimeframesAlign = false — every relaxation of the gate is explicit in the input panel.
Strategy Deep Dive
Every tick the EA first runs IsSafeToTrade() to enforce capital floor, capital cap, equity-protection ratio, daily/weekly loss caps, and the 30-minute cooldown after three consecutive losses, then calls DetectMarketRegime() to classify the current bar as trending up, trending down, ranging, volatile, or quiet. If the regime is acceptable, UpdateMultiTimeframeAnalysis() reads AMA and MACD on the H4 confirmation timeframe and the D1 filter timeframe, and UpdateHullConfirmation() builds a custom Hull MA direction on H4. The signal path then evaluates GetMarketSignalWithRegime() only on a new bar (the new-bar gate enforced by InpSignalOnBarClose = true), with all five indicators — AMA, RSI, MACD, Stochastic, ATR — weighted by the active regime. A combined buy or sell score must reach 4.0 and beat the opposite side by 20% before IsMultiTimeframeAligned() and IsHullConfirmationValid() give the final go/no-go, after which OpenBuyOrder() or OpenSellOrder() sizes the lot through CalculateLotSize() and dispatches the order with the supported filling mode. While the position is open, UpdatePositionManagement() runs the five-stage exit chain every tick: opposite-signal close, 50% partial at 1×ATR, break-even at 1×ATR, ATR-trailing at 1.5×ATR, and 24-hour hard exit. CheckPositionScaling() adds scaled-in positions at 0.8× lot when the trade is at least 1×ATR in profit and the regime is trending, capped at three additions per direction and force-closed at 22:00 server time.
Entries fire only on a closed bar of the user-selected timeframe (M5 default) when GetMarketSignalWithRegime() returns a directional score above 4.0 and 20% above the opposite side. The score is built from five indicators — AMA(14, 2, 30), RSI(14), MACD(12, 26, 9), Stochastic(14, 3, 3), and ATR(14) — reweighted by the current regime (trending favors AMA+MACD+trend, ranging favors RSI+stoch). A long signal additionally needs a bullish H4 AMA, a non-conflicting D1 filter, and Hull MA confirmation; the indicator-correlation gate must pass at 0.7.
Exits run in five stages inside ProcessAdvancedPositionManagement(): (1) opposite-signal close, (2) 50% partial close at 1×ATR profit, (3) break-even move at 1×ATR profit, (4) ATR-multiple trailing at 1.5×ATR that only activates after break-even, and (5) hard time-based exit at MaxTradeHours (24 by default). On top of that, the ProfitLock system ratchets the stop in 10-point increments with a 3-point trail behind the highest locked level, scaling trade-by-trade instead of by a single static trail.
Stop loss is set at SLMultiplier × ATR from entry (default 1.0 ATR), sized so that losing the stop risks exactly RiskPercent of effective capital. A hard InpMaxDDPct = 20% kill switch, MaxDailyLossPercent = 3%, InpMaxWeeklyLossPct = 8%, equity-protection at 80% of initial balance, capital floor at $100, and 30-minute cooldown after 3 consecutive losses all close every open position before another entry is even considered.
Take profit is set at TPMultiplier × ATR from entry (default 2.0 ATR — conservative 1:2 risk-to-reward). Most positions close earlier than TP via the partial-close at 1×ATR profit (50% of the lot), with the remainder left to the trailing system, profit-lock ratchet, or the 24-hour time exit.
Minimum recommended balance is $100 with 1% risk per trade, the level the input panel is calibrated for. The natural home is M5 XAUUSD, where the regime classifier has enough bars to identify a state and the Hull MA at H4 still has signal strength. Because the EA explicitly avoids the Asian session by default and gates on news, the operating window is the London and New York hours in GMT (7–16 London, 12–21 New York, with the overlap 12–16 being the most productive). A broker that offers IOC or FOK filling, low spread on XAUUSD (the 50-point default InpMaxSpread is calibrated for a typical gold-broker tick size), and reliable tick volume is required. The EA is unsuitable for accounts that want constant activity: on a normal week it may print zero to two trades, by design.
Strategy Logic
Pipsgrowth EX01003 Adaptive — Strategy Logic Analysis (from .mq5 source)
Family: Adaptive
Magic: 22201003
Version: 3.00
BRIEF:
Safe but profitable EA with multiple adaptive confirmations — AMA, RSI, MACD, Stoch, ATR, Hull MA, regime detection, multi-timeframe analysis, volatility regime switch. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
DetectFillingMode()DetectMarketRegime()CalculateTrendStrength()CalculateVolatilityLevel()CalculateIndicatorCorrelations()CalculateCorrelation()HasSufficientCorrelation()GetRegimeAdaptedStrength()GetVolatilityMultiplier()IsRegimeSuitableForTrading()GetRegimeString()GetVolatilityRegimeString()- ...and 52 more
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (87 total across 14 groups):
- [=== Identity ===]
InpMagicNumber=22201003// Magic Number - [=== Identity ===]
InpTradeComment= "Psgrowth.com Expert_01003" // TradeComment - [=== Identity ===]
InpTimeframe= 3 // Timeframe: 1=M1,2=M3,3=M5,4=M10,5=M15,6=M30,7=H1,8=H4,9=D1 - [=== Identity ===]
InpSignalOnBarClose=true// Evaluate signals only on new bar close - [=== Identity ===]
InpMaxSpread= 50 // Max spread in points (0=disabled) - [=== Risk Management ===]
RiskPercent=1.0// Risk percentage per trade (max 2% for $100 account) - [=== Risk Management ===]
MaxDailyLossPercent=3.0// Maximum daily loss percentage - [=== Risk Management ===]
MaxTradesPerDay= 5 // Maximum trades per day - [=== Risk Management ===]
MinEquityPercent=80.0// Stop trading if equity falls below this % of initial balance - [=== Risk Management ===]
InpMaxConsecLosses= 3 // Max consecutive losses before cooldown (0=disabled) - [=== Risk Management ===]
InpCooldownMin= 30 // Cooldown minutes after consec losses (0=disabled) - [=== Risk Management ===]
InpMaxWeeklyLossPct=8.0// Max weekly loss % (0=disabled) - [=== Capital Cap ===]
InpCapAmount=0.0// Capital cap amount (stop trading at this equity) - [=== Capital Cap ===]
InpCapFloor=100.0// Capital floor (stop trading below this equity) - [=== Sessions
Management(GMT) ===]InpServerGMTOffset= 0 // ServerGMToffset in hours (0=auto-detect via weekend gap) - [=== Sessions
Management(GMT) ===]InpLondonStartHour= 7 // London session start (GMT) - [=== Sessions
Management(GMT) ===]InpLondonEndHour= 16 // London session end (GMT) - [=== Sessions
Management(GMT) ===]InpNYStartHour= 12 // New York session start (GMT) - [=== Sessions
Management(GMT) ===]InpNYEndHour= 21 // New York session end (GMT) - [=== Sessions
Management(GMT) ===]InpAvoidAsia=true// Avoid Asian session - [=== Sessions
Management(GMT) ===]InpAsiaStartHour= 0 // Asian session start (GMT) - [=== Sessions
Management(GMT) ===]InpAsiaEndHour= 7 // Asian session end (GMT) - [=== Sessions
Management(GMT) ===]AvoidNews=true// Avoid trading during news times - [=== Safety Caps ===]
InpMaxDDPct=20.0// Max total drawdown % (0=disabled, triggers kill switch) - [=== Safety Caps ===]
InpKillSwitch=false// Kill switch (stops all trading immediately) - [=== Safety Caps ===]
InpDryRun=false// Dry-run mode: log signals without trading - [=== Safety Caps ===]
InpMaxLot=100.0// Maximum lot size cap - [=== Adaptive Indicators ===] AMA_Period = 14 // Adaptive Moving Average period
- [=== Adaptive Indicators ===] AMA_FastEMA = 2 // Fast
EMAforAMA - [=== Adaptive Indicators ===] AMA_SlowEMA = 30 // Slow
EMAforAMA - [=== Adaptive Indicators ===] RSI_Period = 14 //
RSIperiod for adaptive calculation - [=== Adaptive Indicators ===] MACD_Fast = 12 //
MACDfast period - [=== Adaptive Indicators ===] MACD_Slow = 26 //
MACDslow period - [=== Adaptive Indicators ===] MACD_Signal = 9 //
MACDsignal period - [=== Adaptive Indicators ===] Stoch_K = 14 // Stochastic %K period
- [=== Adaptive Indicators ===] Stoch_D = 3 // Stochastic %D period
- [=== Adaptive Indicators ===] ATR_Period = 14 //
ATRperiod for volatility - [=== Trade Management ===] TPMultiplier =
2.0// Take Profit multiplier (conservative 1:2 RR) - [=== Trade Management ===] SLMultiplier =
1.0// Stop Loss multiplier - [=== Trade Management ===]
InpEnableBreakEven=true// Enable break-even move - [=== Trade Management ===]
InpEnableProfitLock=true// Enable profit lock - [=== Trade Management ===]
ProfitLockIncrement=10.0// Profit lock increment in points - [=== Trade Management ===]
ProfitLockStep=3.0// Profit lock step (SL trails increment minus step) - [=== Trade Management ===]
InpPyramidGateMode=PyramidGate_ProfitOnly// Pyramid gate mode - [=== Trade Management ===]
InpProfitGatePoints=5.0// Minimum profit in points for pyramid gate - [=== Trade Management ===]
InpMaxOpenPositions= 5 // Max open positions (0=unlimited) - [=== Market Regime Detection ===]
UseMarketRegimeFilter=true// Enable market regime detection - [=== Market Regime Detection ===]
RegimeDetectionPeriod= 50 // Period for regime analysis - [=== Market Regime Detection ===]
TrendThreshold=0.6// Trend strength threshold (0.5-1.0) - [=== Market Regime Detection ===]
VolatilityThreshold=1.5// High volatility threshold multiplier - [=== Market Regime Detection ===]
CorrelationThreshold=0.7// Minimum indicator correlation for signal - [=== Market Regime Detection ===]
AdaptStrategyToRegime=true// Adapt strategy based on regime - [=== Market Regime Detection ===]
RegimeLookbackBars= 100 // Bars to analyze for regime detection - [=== Volatility Regime Settings ===]
UseVolatilityRegimes=true// Enable volatility regime switching - [=== Volatility Regime Settings ===]
LowVolatilityMultiplier=0.7// Position size multiplier for low volatility - [=== Volatility Regime Settings ===]
HighVolatilityMultiplier=0.4// Position size multiplier for high volatility - [=== Volatility Regime Settings ===]
VolatilityPeriod= 20 // Period for volatility calculation - [=== Multi-Timeframe Analysis ===]
UseHigherTimeframes=true// Enable multi-timeframe analysis - [=== Multi-Timeframe Analysis ===]
ConfirmationTimeframe= 8 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Higher TF for trend confirmation - [=== Multi-Timeframe Analysis ===]
FilterTimeframe= 9 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Filter timeframe for major trend - [=== Multi-Timeframe Analysis ===]
RequireAllTimeframesAlign=false// Require all timeframes to align - [=== Multi-Timeframe Analysis ===]
HigherTFTrendStrength=0.3// Minimum trend strength on higher TF - [=== Market Quality Filters ===]
UseSpreadFilter=true// Enable spread filtering - [=== Market Quality Filters ===]
MaxSpreadMultiplier=2.0// Max spread as multiple of average - [=== Market Quality Filters ===]
AvoidLowLiquidity=true// Skip trading during low liquidity - [=== Market Quality Filters ===]
SpreadAveragePeriod= 20 // Period for average spread calculation - [=== Market Quality Filters ===]
MinLiquidityVolume= 100 // Minimum tick volume for liquidity - [=== Advanced Position Management ===]
UsePartialCloses=true// Enable partial profit taking - [=== Advanced Position Management ===]
PartialClosePercent=50.0// % to close at first target - [=== Advanced Position Management ===]
PartialCloseTarget=1.0//ATRmultiplier for partial close - [=== Advanced Position Management ===]
BreakEvenTrigger=1.0// Move SL to BE after X*ATRprofit - [=== Advanced Position Management ===]
UseAdvancedTrailing=true// Advanced trailing stop system - [=== Advanced Position Management ===]
TrailingATRMultiplier=1.5//ATRmultiplier for trailing distance - [=== Advanced Position Management ===]
UseTimeBasedExit=true// Exit trades after certain time - [=== Advanced Position Management ===]
MaxTradeHours= 24 // Maximum trade duration in hours - [=== Confirm ===]
UseHullConfirmation=true// Use Hull MA for trend confirmation - [=== Confirm ===]
HullTimeframe= 8 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Hull MA timeframe - [=== Confirm ===]
HullPeriod= 21 // Hull MA period - [=== Confirm ===]
HullSignalStrength=0.7// Minimum Hull signal strength (0.1-1.0) - [=== Confirm ===]
RequireHullAlignment=true// Require Hull MA alignment for trades - [=== Scaling ===]
UsePositionScaling=true// Enable additional trades when profitable - [=== Scaling ===]
MinimumProfitATR=1.0// Minimum profit inATRto add new positions - [=== Scaling ===]
MaxAdditionalPositions= 3 // Maximum additional positions per direction - [=== Scaling ===]
ScalingLotMultiplier=0.8// Lot size multiplier for additional trades - [=== Scaling ===]
UseTimeBasedClosing=true// Close additional trades at specific time - [=== Scaling ===]
CloseAdditionalTradesHour= 22 // Hour to close additional trades (0-23) - [=== Scaling ===]
AllowScalingOnlyInTrend=true// Only scale in trending markets
// Pipsgrowth EX01003 Adaptive — Execution Flow (from source analysis)
// Family: Adaptive
// Safe but profitable EA with multiple adaptive confirmations — AMA, RSI, MACD, Stoch, ATR, Hull MA, regime detection, multi-timeframe analysis, volatility regime switch. 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 a chart matching the recommended timeframe
- 7Configure parameters according to the table on this page
- 8Enable Allow Algo Trading and click OK
EA Parameters
| Parameter | Default | Description |
|---|---|---|
| InpMagicNumber | 22201003 | Magic Number |
| InpTradeComment | "Psgrowth.com Expert_01003" | Trade Comment |
| InpTimeframe | 3 | Timeframe: 1=M1,2=M3,3=M5,4=M10,5=M15,6=M30,7=H1,8=H4,9=D1 |
| InpSignalOnBarClose | true | Evaluate signals only on new bar close |
| InpMaxSpread | 50 | Max spread in points (0=disabled) |
| RiskPercent | 1.0 | Risk percentage per trade (max 2% for $100 account) |
| MaxDailyLossPercent | 3.0 | Maximum daily loss percentage |
| MaxTradesPerDay | 5 | Maximum trades per day |
| MinEquityPercent | 80.0 | Stop trading if equity falls below this % of initial balance |
| InpMaxConsecLosses | 3 | Max consecutive losses before cooldown (0=disabled) |
| InpCooldownMin | 30 | Cooldown minutes after consec losses (0=disabled) |
| InpMaxWeeklyLossPct | 8.0 | Max weekly loss % (0=disabled) |
| InpCapAmount | 0.0 | Capital cap amount (stop trading at this equity) |
| InpCapFloor | 100.0 | Capital floor (stop trading below this equity) |
| InpServerGMTOffset | 0 | Server GMT offset in hours (0=auto-detect via weekend gap) |
| InpLondonStartHour | 7 | London session start (GMT) |
| InpLondonEndHour | 16 | London session end (GMT) |
| InpNYStartHour | 12 | New York session start (GMT) |
| InpNYEndHour | 21 | New York session end (GMT) |
| InpAvoidAsia | true | Avoid Asian session |
| InpAsiaStartHour | 0 | Asian session start (GMT) |
| InpAsiaEndHour | 7 | Asian session end (GMT) |
| AvoidNews | true | Avoid trading during news times |
| InpMaxDDPct | 20.0 | Max total drawdown % (0=disabled, triggers kill switch) |
| InpKillSwitch | false | Kill switch (stops all trading immediately) |
| InpDryRun | false | Dry-run mode: log signals without trading |
| InpMaxLot | 100.0 | Maximum lot size cap |
| AMA_Period | 14 | Adaptive Moving Average period |
| AMA_FastEMA | 2 | Fast EMA for AMA |
| AMA_SlowEMA | 30 | Slow EMA for AMA |
| RSI_Period | 14 | RSI period for adaptive calculation |
| MACD_Fast | 12 | MACD fast period |
| MACD_Slow | 26 | MACD slow period |
| MACD_Signal | 9 | MACD signal period |
| Stoch_K | 14 | Stochastic %K period |
| Stoch_D | 3 | Stochastic %D period |
| ATR_Period | 14 | ATR period for volatility |
| TPMultiplier | 2.0 | Take Profit multiplier (conservative 1:2 RR) |
| SLMultiplier | 1.0 | Stop Loss multiplier |
| InpEnableBreakEven | true | Enable break-even move |
| InpEnableProfitLock | true | Enable profit lock |
| ProfitLockIncrement | 10.0 | Profit lock increment in points |
| ProfitLockStep | 3.0 | Profit lock step (SL trails increment minus step) |
| InpPyramidGateMode | PyramidGate_ProfitOnly | Pyramid gate mode |
| InpProfitGatePoints | 5.0 | Minimum profit in points for pyramid gate |
| InpMaxOpenPositions | 5 | Max open positions (0=unlimited) |
| UseMarketRegimeFilter | true | Enable market regime detection |
| RegimeDetectionPeriod | 50 | Period for regime analysis |
| TrendThreshold | 0.6 | Trend strength threshold (0.5-1.0) |
| VolatilityThreshold | 1.5 | High volatility threshold multiplier |
| CorrelationThreshold | 0.7 | Minimum indicator correlation for signal |
| AdaptStrategyToRegime | true | Adapt strategy based on regime |
| RegimeLookbackBars | 100 | Bars to analyze for regime detection |
| UseVolatilityRegimes | true | Enable volatility regime switching |
| LowVolatilityMultiplier | 0.7 | Position size multiplier for low volatility |
| HighVolatilityMultiplier | 0.4 | Position size multiplier for high volatility |
| VolatilityPeriod | 20 | Period for volatility calculation |
| UseHigherTimeframes | true | Enable multi-timeframe analysis |
| ConfirmationTimeframe | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Higher TF for trend confirmation |
| FilterTimeframe | 9 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Filter timeframe for major trend |
| RequireAllTimeframesAlign | false | Require all timeframes to align |
| HigherTFTrendStrength | 0.3 | Minimum trend strength on higher TF |
| UseSpreadFilter | true | Enable spread filtering |
| MaxSpreadMultiplier | 2.0 | Max spread as multiple of average |
| AvoidLowLiquidity | true | Skip trading during low liquidity |
| SpreadAveragePeriod | 20 | Period for average spread calculation |
| MinLiquidityVolume | 100 | Minimum tick volume for liquidity |
| UsePartialCloses | true | Enable partial profit taking |
| PartialClosePercent | 50.0 | % to close at first target |
| PartialCloseTarget | 1.0 | ATR multiplier for partial close |
| BreakEvenTrigger | 1.0 | Move SL to BE after X*ATR profit |
| UseAdvancedTrailing | true | Advanced trailing stop system |
| TrailingATRMultiplier | 1.5 | ATR multiplier for trailing distance |
| UseTimeBasedExit | true | Exit trades after certain time |
| MaxTradeHours | 24 | Maximum trade duration in hours |
| UseHullConfirmation | true | Use Hull MA for trend confirmation |
| HullTimeframe | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Hull MA timeframe |
| HullPeriod | 21 | Hull MA period |
| HullSignalStrength | 0.7 | Minimum Hull signal strength (0.1-1.0) |
| RequireHullAlignment | true | Require Hull MA alignment for trades |
| UsePositionScaling | true | Enable additional trades when profitable |
| MinimumProfitATR | 1.0 | Minimum profit in ATR to add new positions |
| MaxAdditionalPositions | 3 | Maximum additional positions per direction |
| ScalingLotMultiplier | 0.8 | Lot size multiplier for additional trades |
| UseTimeBasedClosing | true | Close additional trades at specific time |
| CloseAdditionalTradesHour | 22 | Hour to close additional trades (0-23) |
| AllowScalingOnlyInTrend | true | Only scale in trending markets |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "3.00"
#property strict
#property description "Pipsgrowth.com EX01003 AdaptiveForexMaster FillingMode Fixed — multi-adaptive confirmation EA, full 12-layer stack, configurable timeframe, trailing/BE/profit-lock toggles, pyramid gate, spread filter, new-bar gate."
#include <Trade/Trade.mqh>
#include <Trade/SymbolInfo.mqh>
//--- pyramid gate mode enum
enum PyramidGateMode
{
PyramidGate_Off=0, // No pyramid gate
PyramidGate_ProfitOnly, // Require existing trades be in profit
PyramidGate_ProfitAndSL // Require profit + SL secured in profit
};
//--- Timeframe mapping: 1=M1, 2=M3, 3=M5, 4=M10, 5=M15, 6=M30, 7=H1, 8=H4, 9=D1
ENUM_TIMEFRAMES MapTimeframe(int tf)
{
switch(tf)
{
case 1: return PERIOD_M1;
case 2: return PERIOD_M3;
case 3: return PERIOD_M5;
case 4: return PERIOD_M10;
case 5: return PERIOD_M15;
case 6: return PERIOD_M30;
case 7: return PERIOD_H1;
case 8: return PERIOD_H4;
case 9: return PERIOD_D1;
default: return PERIOD_M5;
}
}
// Input Parameters
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_TIMEFRAMES g_ConfirmationTimeframe = PERIOD_H1;
ENUM_TIMEFRAMES g_FilterTimeframe = PERIOD_H1;
ENUM_TIMEFRAMES g_HullTimeframe = PERIOD_H1;
input group "=== Identity ==="
input ulong InpMagicNumber = 22201003; // Magic Number
input string InpTradeComment = "Psgrowth.com Expert_01003"; // Trade Comment
input int InpTimeframe = 3; // Timeframe: 1=M1,2=M3,3=M5,4=M10,5=M15,6=M30,7=H1,8=H4,9=D1
input bool InpSignalOnBarClose = true; // Evaluate signals only on new bar close
input int InpMaxSpread = 50; // Max spread in points (0=disabled)
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 Other strategy EAs from our library
Pipsgrowth EX01007 Adaptive
Pipsgrowth.com EX01007 Adaptive XAUUSD 5M — multi-indicator signal scorer with regime filter, full 12-layer stack, configurable timeframe, trailing/BE/profit-lock toggles, pyramid gate, spread filter, new-bar gate, filling mode detection.
Pipsgrowth EX01019 Adaptive
Pipsgrowth.com EX01019 Self-Adaptive Market EA Fixed — multi-regime adaptive EA, full 12-layer stack.
Pipsgrowth EX15029 SMC-OrderBlock
Pipsgrowth.com EX15029 SMCBreakoutEA — SMC breakout CHOCH/liquidity sweep EA, full 12-layer stack.
Community
Educational purposes only. Do NOT use with real money. Test on demo accounts only.