P
PipsGrowth
OtherOpen Source – Free

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.51.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.

Entry Signal

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.

Exit Signal

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

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

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.

Best For

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 MT5 indicators

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" // Trade Comment
  • [=== 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 // Server GMT offset 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 EMA for AMA
  • [=== Adaptive Indicators ===] AMA_SlowEMA = 30 // Slow EMA for AMA
  • [=== Adaptive Indicators ===] RSI_Period = 14 // RSI period for adaptive calculation
  • [=== Adaptive Indicators ===] MACD_Fast = 12 // MACD fast period
  • [=== Adaptive Indicators ===] MACD_Slow = 26 // MACD slow period
  • [=== Adaptive Indicators ===] MACD_Signal = 9 // MACD signal period
  • [=== Adaptive Indicators ===] Stoch_K = 14 // Stochastic %K period
  • [=== Adaptive Indicators ===] Stoch_D = 3 // Stochastic %D period
  • [=== Adaptive Indicators ===] ATR_Period = 14 // ATR period 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 // ATR multiplier for partial close
  • [=== Advanced Position Management ===] BreakEvenTrigger = 1.0 // Move SL to BE after X*ATR profit
  • [=== Advanced Position Management ===] UseAdvancedTrailing = true // Advanced trailing stop system
  • [=== Advanced Position Management ===] TrailingATRMultiplier = 1.5 // ATR multiplier 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 in ATR to 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
Pseudocode
// 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

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 onto a chart matching the recommended timeframe
  7. 7Configure parameters according to the table on this page
  8. 8Enable Allow Algo Trading and click OK

EA Parameters

ParameterDefaultDescription
InpMagicNumber22201003Magic Number
InpTradeComment"Psgrowth.com Expert_01003"Trade Comment
InpTimeframe3Timeframe: 1=M1,2=M3,3=M5,4=M10,5=M15,6=M30,7=H1,8=H4,9=D1
InpSignalOnBarClosetrueEvaluate signals only on new bar close
InpMaxSpread50Max spread in points (0=disabled)
RiskPercent1.0Risk percentage per trade (max 2% for $100 account)
MaxDailyLossPercent3.0Maximum daily loss percentage
MaxTradesPerDay5Maximum trades per day
MinEquityPercent80.0Stop trading if equity falls below this % of initial balance
InpMaxConsecLosses3Max consecutive losses before cooldown (0=disabled)
InpCooldownMin30Cooldown minutes after consec losses (0=disabled)
InpMaxWeeklyLossPct8.0Max weekly loss % (0=disabled)
InpCapAmount0.0Capital cap amount (stop trading at this equity)
InpCapFloor100.0Capital floor (stop trading below this equity)
InpServerGMTOffset0Server GMT offset in hours (0=auto-detect via weekend gap)
InpLondonStartHour7London session start (GMT)
InpLondonEndHour16London session end (GMT)
InpNYStartHour12New York session start (GMT)
InpNYEndHour21New York session end (GMT)
InpAvoidAsiatrueAvoid Asian session
InpAsiaStartHour0Asian session start (GMT)
InpAsiaEndHour7Asian session end (GMT)
AvoidNewstrueAvoid trading during news times
InpMaxDDPct20.0Max total drawdown % (0=disabled, triggers kill switch)
InpKillSwitchfalseKill switch (stops all trading immediately)
InpDryRunfalseDry-run mode: log signals without trading
InpMaxLot100.0Maximum lot size cap
AMA_Period14Adaptive Moving Average period
AMA_FastEMA2Fast EMA for AMA
AMA_SlowEMA30Slow EMA for AMA
RSI_Period14RSI period for adaptive calculation
MACD_Fast12MACD fast period
MACD_Slow26MACD slow period
MACD_Signal9MACD signal period
Stoch_K14Stochastic %K period
Stoch_D3Stochastic %D period
ATR_Period14ATR period for volatility
TPMultiplier2.0Take Profit multiplier (conservative 1:2 RR)
SLMultiplier1.0Stop Loss multiplier
InpEnableBreakEventrueEnable break-even move
InpEnableProfitLocktrueEnable profit lock
ProfitLockIncrement10.0Profit lock increment in points
ProfitLockStep3.0Profit lock step (SL trails increment minus step)
InpPyramidGateModePyramidGate_ProfitOnlyPyramid gate mode
InpProfitGatePoints5.0Minimum profit in points for pyramid gate
InpMaxOpenPositions5Max open positions (0=unlimited)
UseMarketRegimeFiltertrueEnable market regime detection
RegimeDetectionPeriod50Period for regime analysis
TrendThreshold0.6Trend strength threshold (0.5-1.0)
VolatilityThreshold1.5High volatility threshold multiplier
CorrelationThreshold0.7Minimum indicator correlation for signal
AdaptStrategyToRegimetrueAdapt strategy based on regime
RegimeLookbackBars100Bars to analyze for regime detection
UseVolatilityRegimestrueEnable volatility regime switching
LowVolatilityMultiplier0.7Position size multiplier for low volatility
HighVolatilityMultiplier0.4Position size multiplier for high volatility
VolatilityPeriod20Period for volatility calculation
UseHigherTimeframestrueEnable multi-timeframe analysis
ConfirmationTimeframe8Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Higher TF for trend confirmation
FilterTimeframe9Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Filter timeframe for major trend
RequireAllTimeframesAlignfalseRequire all timeframes to align
HigherTFTrendStrength0.3Minimum trend strength on higher TF
UseSpreadFiltertrueEnable spread filtering
MaxSpreadMultiplier2.0Max spread as multiple of average
AvoidLowLiquiditytrueSkip trading during low liquidity
SpreadAveragePeriod20Period for average spread calculation
MinLiquidityVolume100Minimum tick volume for liquidity
UsePartialClosestrueEnable partial profit taking
PartialClosePercent50.0% to close at first target
PartialCloseTarget1.0ATR multiplier for partial close
BreakEvenTrigger1.0Move SL to BE after X*ATR profit
UseAdvancedTrailingtrueAdvanced trailing stop system
TrailingATRMultiplier1.5ATR multiplier for trailing distance
UseTimeBasedExittrueExit trades after certain time
MaxTradeHours24Maximum trade duration in hours
UseHullConfirmationtrueUse Hull MA for trend confirmation
HullTimeframe8Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Hull MA timeframe
HullPeriod21Hull MA period
HullSignalStrength0.7Minimum Hull signal strength (0.1-1.0)
RequireHullAlignmenttrueRequire Hull MA alignment for trades
UsePositionScalingtrueEnable additional trades when profitable
MinimumProfitATR1.0Minimum profit in ATR to add new positions
MaxAdditionalPositions3Maximum additional positions per direction
ScalingLotMultiplier0.8Lot size multiplier for additional trades
UseTimeBasedClosingtrueClose additional trades at specific time
CloseAdditionalTradesHour22Hour to close additional trades (0-23)
AllowScalingOnlyInTrendtrueOnly scale in trending markets
Source Code (.mq5)Open Source
Pipsgrowth_com_EX01003.mq5
#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.

Tags:ex01003adaptivepipsgrowthfreemt5xauusd

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_EX01003.mq5
File Size117.6 KB
Versionv3.00
PlatformMetaTrader 5
File Type.mq5 Source
StrategyOther
Risk LevelMedium Risk
Timeframes
M5H1
Currency Pairs
XAUUSD
Min. Deposit$100