P
PipsGrowth
Trend FollowingOpen Source – Free

Pipsgrowth EX16104 Trend

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

Pipsgrowth.com EX16104 Hull2EA — four Hull V7 indicator trend EA with advanced exits, full 12-layer stack.

Overview

Hull V7 plus a protection stack that is denser than the signal side: that is the unusual shape of Pipsgrowth EX16104. Where most trend EAs pile filters onto entries and leave the back end thin, EX16104 ships a 12-layer forward path and then loads eight distinct risk-governor modules on top of it. The result is a strategy that takes relatively few trades but manages the ones it does take with what is, in effect, a small risk-control department running on every tick.

The signal path is built on a custom CHullV7Calculator class. Three instances of the class are active in the input panel — Hull1, Hull3, and Hull4 — each holding its own period, divisor, applied price, optional ADX filter, and flat-detection sensitivity. The calculator does the entire Hull V7 math inline rather than calling a built-in iCustom. For any given bar, it pulls the price series back far enough to build the inner 2*WMA(period/divisor) - WMA(period) term, smooths the result with a WMA of sqrt(period), and returns 1, -1, or 0 based on whether the smoothed value is rising, falling, or flat. The flat test is what separates this from a plain Hull: if the slope of the Hull value across m_flatBars is less than m_flatSensitivity * point, the instance returns 0 and abstains from the vote. The optional ADX filter behaves the same way — a quiet ADX turns the instance neutral rather than letting it cast a noisy vote.

The three instances vote on each closed bar (InpSignalBarShift=1 prevents live-bar repaint). HullConsensusAtShift tallies long votes and short votes, then calls a long entry when longVotes ≥ g_minInitialAgreement (default 1, configured 2 in shipping) and shortVotes = 0; the mirror holds for shorts. The g_minAdditionalAgreement parameter (default 1) drops the threshold once a position in that direction is already open, so additional entries can stack with looser agreement. Stability is enforced by SignalIsStable, which walks InpStableBarsRequired (default 2) prior bars and demands the same consensus held across all of them — a single-tick flip cannot trigger a fill.

The default parameters for the three Hull instances are deliberately mismatched. Hull1 uses period 65, divisor 16.5, weighted price, on M1 — a fast responsive instance that catches the first shift. Hull3 uses period 48, divisor 6.2, median price, SMA, on D1 with an ADX(101) filter at threshold 84. Hull4 uses period 185, divisor 13.4, high price, LWMA, on D1 with an ADX(116) filter at threshold 192 (a high bar that only fires in strong daily trends). The mix is intentional: a fast M1 trigger, a daily median that filters chop, and a daily high-price LWMA that only confirms when the move is strong enough to push the high through its envelope. The 2-of-3 majority rule means the daily anchors have to agree with the M1 trigger before any entry fires.

The exit side is where EX16104 breaks the standard trend-EA mold. Rather than relying on a fixed TP or a single trailing stop, the exit engine runs seven independent strategies: CCI divergence (ExitCheckCCI), MACD slope (ExitCheckMACDSlope), swing high/low breakout (ExitCheckSwing), Stochastic (ExitCheckStochastic), Rate of Change (ExitCheckROC), multi-timeframe confirmation (ExitCheckMTF), and Parabolic SAR (ExitCheckSAR). A consensus wrapper (ExitCheckAll) requires InpMinExitsAgreeProfit votes (default 1) to close a profitable position and InpMinExitsAgreeLoss (default 1) to close one in loss. The InpAllowIndividualExits toggle turns consensus off in favor of letting any single strategy fire on its own. A reverse Hull vote adds a third exit path: 3-of-3 opposite agreement closes any position with 80+ points of profit; 4-of-4 opposite agreement closes even losing positions when InpCloseOnOppositeEvenIfInLose is true.

Alongside the exit consensus, the standard trade-management modules run: CheckProfitScalingExit, CheckTimeBasedExit, CheckBreakEvenAndLock, and CheckVolatilitySpikeExit. CheckSRExit uses GetSwingHigh and GetSwingLow to close positions that stall into support or resistance. The trailing stop ratchets in 20-point steps after a 550-point profit trigger (InpTrailingTriggerPts/InpTrailingStepPts); break-even moves the SL to entry+35 once profit reaches 288 points. The optional profit lock walks the SL forward by 20 points every 500 points of new profit — practical on XAUUSD where a 500-point gold move is a normal session.

Risk control is where the codebase devotes the most parameters. The position-size model defaults to MM_MODE_PERCENT_RISK at 5.5% of balance per trade, with lot rounding by LOT_ROUND_NEAREST and clamping to the broker's min/max/step. The permanent-stop layer monitors three triggers: a 20% balance drawdown, a $2,000 currency drawdown, and 10 consecutive losses. The temporary-pause layer mirrors it at 10% / $1,000 / 5 losses, then enforces a 60-minute cooldown before resuming. The daily-loss layer caps daily drawdown at $500 or 5% of balance (auto-resets next day). The sequence-protection layer pauses for 12 hours if the EA logs 5 consecutive same-side trades, or if the win rate over the last 10 trades falls below 40%. The volatility-guard layer uses a 20-bar sample to detect when current volatility is more than 2.5× the average and pauses new entries, optionally inflating the slippage tolerance up to 3× to handle the wilder conditions. The exposure-limit layer caps total position value at 15% of equity and enforces a 0.95 equity/balance floor. The recovery-mode layer activates at 10% drawdown, cuts lot size by half, and only exits recovery after 3 profitable trades. The connection-monitor layer retries failed orders 3 times with 1-second delays, with a 1-second execution time budget; if it cannot connect within budget, it force-closes open positions.

A correlation monitor (ConfigureCorrelationMonitor / CorrelationMonitorHandlePositions) tracks the live correlation between XAUUSD and 7 majors — USDJPY by default, with EURUSD, GBPUSD, AUDUSD, NZDUSD, USDCAD, and USDCHF all toggleable — on the H1 correlation timeframe with a 35-bar lookback. A minimum absolute correlation of 3.975 is enforced (the values are scaled, not raw Pearson), and a divergence of 0.25 over the lookback triggers either an entry block or a forced close depending on the InpCorrelationClosePositions toggle. The EventPause system layers CSV-driven news windows on top of this, with NFP first-Friday detection, configurable lead/lag times (15 minutes default), and a default symbol key of USDJPY — change the file name and key in the inputs to monitor a different high-impact series. The first-Friday guard also runs independently, halting entries from 8:30 broker time ±30 minutes around the NFP release.

The EA's safety-net density comes at a configuration cost. The source defines 480 input parameters across 66 groups. Most confirmation filters are off by default (InpEnableRsiConfirmation is the only entry filter on alongside Hull voting), so the practical operator is dealing with the trade-management, risk, and Hull sections — roughly 80 to 100 active inputs. The dashboard module (CDashboardGuard) renders a status panel that updates on every tick to show which filter is currently blocking, the live Hull vote tally, the consensus margin, and the event-pause status string.

In backtest, the model is what you would expect from a 5.5%-per-trade, 1:10 risk-reward setup with a strict 2-of-3 Hull consensus and an eight-layer risk governor. Trade frequency is low — the D1-anchored Hull3 and Hull4 rarely agree on fast M5 charts, so the EA waits for clean multi-timeframe alignment before firing. Equity curves tend to stair-step with occasional sharp pullbacks when the 5-loss or 10-loss circuit breaker trips. The 5.5% per-trade risk is aggressive; balance sizing in the $1,000+ range gives the eight risk layers room to act without prematurely tripping the permanent-stop, and the EA's own exposure module effectively treats sub-$200 balances as untradeable.

Strategy Deep Dive

The CHullV7Calculator class computes each Hull V7 value inline from raw WMA(period/divisor) and WMA(period) inputs, returning 1 (long), -1 (short), or 0 (flat) per instance, and folds an ADX filter and a flat-detection slope test into the same GetDirection(shift) call. HullConsensusAtShift tallies the votes, g_minInitialAgreement (default 1, configured 2) controls the entry threshold, and SignalIsStable walks InpStableBarsRequired prior bars to reject one-tick flips. The exit side is handled by CheckProfitScalingExit, CheckTimeBasedExit, CheckMomentumExit, CheckBreakEvenAndLock, CheckVolatilitySpikeExit, CheckSRExit, and the 7-strategy ExitCheckAll consensus. CorrelationMonitorHandlePositions reacts when XAUUSD diverges from up to 7 major pairs; eight risk modules — permanent stop, temporary pause, daily loss cap, sequence protection, volatility guard, exposure limit, recovery mode, and connection monitor — all run as no-trade gates on every tick.

Entry Signal

A long entry fires when at least 2 of the 3 active Hull V7 instances (Hull1 M1, Hull3 D1, Hull4 D1) vote long and zero vote short, with the same consensus stable across the last 2 closed bars (InpSignalBarShift=1, InpStableBarsRequired=2). Once a position is open in that direction, the threshold drops to 1-of-3 for additional same-direction entries (g_minAdditionalAgreement=1). The MTF trend alignment, ADX, RSI(41), and 14 other confirmation filters can each veto the entry independently; only Hull voting and the RSI confirmation are enabled in the default config.

Exit Signal

Exit is governed by a 7-strategy consensus engine — CCI divergence, MACD slope, swing high/low, Stochastic, ROC, MTF, and Parabolic SAR — that requires at least 1 vote (default InpMinExitsAgreeProfit=1) before closing a profitable position and the same for loss exits. A reverse Hull vote adds a second path: 3-of-3 opposite agreement closes any position with 80+ points of profit, while 4-of-4 opposite agreement closes losing positions when InpCloseOnOppositeEvenIfInLose is true. CheckSRExit closes positions stalling into support or resistance; time-based and weekend exits run in parallel.

Stop Loss

Initial stop is 200 points from entry (InpStopLossPoints=200.0), tightened to entry+35 once profit reaches 288 points (InpBreakEvenTrigger=288, InpBreakEvenOffset=35). A trailing stop ratchets the SL in 20-point steps after a 550-point profit trigger (InpTrailingTriggerPts=550, InpTrailingStepPts=20). The optional profit-lock mode walks the SL forward 20 points every 500 points of new profit.

Take Profit

Initial take-profit is 2000 points (InpTakeProfitPoints=2000.0), a 1:10 risk-reward against the 200-point stop. The trailing-stop philosophy is to let winners run well past TP; the 7-strategy consensus exit and reverse-Hull signals usually close the trade before the original TP is reached.

Best For

Recommended minimum balance is $100 on a low-spread XAUUSD broker, sized to the MEDIUM risk profile; the 5.5% per-trade risk and 8-layer risk governor assume balances in the $1,000+ range to give the temporary-pause and permanent-stop modules room to act. Best on the M5 and H1 charts where the M1 Hull1 instance can pair with the D1 Hull3 and Hull4 anchors for multi-timeframe alignment. ECN or RAW-spread execution matters because the EA's volatility guard watches the live spread and the InpEnableMarginGuard at 240% blocks entries when account margin is tight.

Strategy Logic

Pipsgrowth EX16104 Trend — Strategy Logic Analysis (from .mq5 source)

Family: Trend Magic: 22216104 Version: 2.00

BRIEF: Expert Advisor that trades using four Hull V7 indicators with advanced exit strategies and multi-layer risk management. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester

INDICATOR STACK:

  • tfRsiHandle
  • tfEmaFastHandle
  • tfEmaSlowHandle

KEY FUNCTIONS:

  • PrepareTradeComment()
  • ExitShouldClosePosition()
  • ExitGetPositionProfitPoints()
  • ExitSortPositionsByAge()
  • ExitFindRecentPivots()
  • ExitDetectCCIDivergence()
  • ExitCalculateROC()
  • ExitGetSwingHighLow()
  • ExitDeinit()
  • ExitInit()
  • ExitRequestedStrategyCount()
  • ExitReadyStrategyCount()
  • ...and 170 more

INTERNAL CONSTANTS (0 total):

INPUT PARAMETERS (480 total across 66 groups):

  • [=== Trade Settings ===] InpLots = 0.10 // Fixed lot size (0.01,0.01,50.0)
  • [=== Trade Settings ===] InpSlippagePoints = 20 // Max slippage (points) (0,1,100)
  • [=== Trade Settings ===] InpMagicNumber = 22216104 // Magic number (1,1,99999999)
  • [=== Trade Settings ===] InpTradeComment = "Psgrowth.com Expert_16104" // Trade comment for new positions
  • [=== Money Management ===] InpMoneyManagementMode = MM_MODE_PERCENT_RISK // Money management mode
  • [=== Money Management ===] InpRiskPerTradePercent = 5.5 // Risk per trade (% of balance) (0.1,0.1,10.0)
  • [=== Money Management ===] InpLotRoundingMode = LOT_ROUND_NEAREST // Lot rounding mode
  • [=== Risk Management ===] InpStopLossPoints = 200.0 // Initial stop loss (points) (10.0,1.0,5000.0)
  • [=== Risk Management ===] InpTakeProfitPoints = 2000.0 // Initial take profit (points) (10.0,1.0,10000.0)
  • [=== Risk Management ===] InpEnableMarginGuard = true // Enforce minimum margin level before new trades
  • [=== Risk Management ===] InpMinMarginLevelPerc = 240.0 // Minimum margin level (%) (100.0,1.0,1000.0)
  • [=== Risk Management ===] InpEnableFreeMarginGuard = false // Enforce minimum free margin before new trades
  • [=== Risk Management ===] InpMinFreeMarginCurrency = 0.0 // Minimum free margin (account currency)
  • [=== Trailing Management ===] InpEnableTrailingStop = true // Master toggle for trailing stop management
  • [=== Trailing Management ===] InpTrailingTriggerPts = 550.0 // Trailing stop trigger (points) (5.0,1.0,500.0)
  • [=== Trailing Management ===] InpTrailingStepPts = 20.0 // Trailing stop step (points) (10.0,1.0,2000.0)
  • [=== Break-Even ===] InpEnableBreakEven = true // Move SL to break-even
  • [=== Break-Even ===] InpBreakEvenTrigger = 288.0 // Profit trigger (points) (5.0,1.0,500.0)
  • [=== Break-Even ===] InpBreakEvenOffset = 35.0 // Offset from entry (points) (0.0,1.0,100.0)
  • [=== Lock Profit ===] InpEnableProfitLock = false // Lock profits
  • [=== Lock Profit ===] InpProfitLockIncrement = 500.0 // Lock every X points (10.0,1.0,500.0)
  • [=== Lock Profit ===] InpProfitLockStep = 20.0 // Distance from current price (1.0,1.0,200.0)
  • [=== Additional Trade Controls ===] InpEnableProfitGate = true // Require existing trades be in profit
  • [=== Additional Trade Controls ===] InpProfitGatePoints = 10.0 // Minimum profit (points) per trade (1.0,1.0,500.0)
  • [=== Additional Trade Controls ===] InpMaxOpenPositions = 0 // Maximum open positions (0=unlimited) (0,1,100)
  • [=== Protection Layer 1: Permanent Stop ===] InpEnablePermanentStop = false // Enable permanent stop (hard shutdown)
  • [=== Protection Layer 1: Permanent Stop ===] InpPermanentStopUseDrawdownPercent = true // Use drawdown % threshold for permanent stop
  • [=== Protection Layer 1: Permanent Stop ===] InpPermanentStopDrawdownPercent = 20.0 // Max drawdown % to trigger permanent stop (1.0,0.5,50.0)
  • [=== Protection Layer 1: Permanent Stop ===] InpPermanentStopUseDrawdownCurrency = true // Use drawdown currency threshold for permanent stop
  • [=== Protection Layer 1: Permanent Stop ===] InpPermanentStopDrawdownCurrency = 2000.0 // Max drawdown $ to trigger permanent stop (10.0,10.0,10000.0)
  • [=== Protection Layer 1: Permanent Stop ===] InpPermanentStopUseConsecutiveLosses = true // Use consecutive loss threshold for permanent stop
  • [=== Protection Layer 1: Permanent Stop ===] InpPermanentStopConsecutiveLosses = 10 // Max consecutive losses to trigger permanent stop (1,1,20)
  • [=== Protection Layer 1: Permanent Stop ===] InpPermanentStopCloseAll = true // Close all positions on permanent stop
  • [=== Protection Layer 1: Permanent Stop ===] InpPermanentStopNotify = true // Send alert on permanent stop
  • [=== Protection Layer 2: Temporary Pause ===] InpEnableTemporaryPause = false // Enable temporary pause (recoverable)
  • [=== Protection Layer 2: Temporary Pause ===] InpPauseUseDrawdownPercent = true // Use drawdown % trigger for temporary pause
  • [=== Protection Layer 2: Temporary Pause ===] InpPauseDrawdownPercent = 10.0 // Drawdown % to trigger pause (1.0,0.5,50.0)
  • [=== Protection Layer 2: Temporary Pause ===] InpPauseUseDrawdownCurrency = true // Use drawdown currency trigger for temporary pause
  • [=== Protection Layer 2: Temporary Pause ===] InpPauseDrawdownCurrency = 1000.0 // Drawdown $ to trigger pause (10.0,10.0,10000.0)
  • [=== Protection Layer 2: Temporary Pause ===] InpPauseUseConsecutiveLosses = true // Use consecutive loss trigger for temporary pause
  • [=== Protection Layer 2: Temporary Pause ===] InpPauseConsecutiveLosses = 5 // Consecutive losses to trigger pause (1,1,20)
  • [=== Protection Layer 2: Temporary Pause ===] InpPauseUseCooldown = true // Apply cooldown timer for temporary pause
  • [=== Protection Layer 2: Temporary Pause ===] InpPauseCooldownMinutes = 60 // Cooldown period before auto-resume (0,10,1440)
  • [=== Protection Layer 2: Temporary Pause ===] InpPauseClosePositions = true // Close positions when pause triggers
  • [=== Protection Layer 2: Temporary Pause ===] InpPauseNotify = true // Send alert when pause triggers
  • [=== Daily/Session Loss Protection ===] InpEnableDailyLimit = false // Enable daily loss limit
  • [=== Daily/Session Loss Protection ===] InpDailyLimitUseCurrency = true // Use currency-based daily loss limit
  • [=== Daily/Session Loss Protection ===] InpDailyLossLimitCurrency = 500.0 // Max daily loss in account currency (50.0,10.0,10000.0)
  • [=== Daily/Session Loss Protection ===] InpDailyLimitUsePercent = true // Use percentage-based daily loss limit
  • [=== Daily/Session Loss Protection ===] InpDailyLossLimitPercent = 5.0 // Max daily loss as % of balance (0.5,0.1,25.0)
  • [=== Daily/Session Loss Protection ===] InpDailyLimitResumeNextDay = true // Auto-resume at next market day
  • [=== Daily/Session Loss Protection ===] InpDailyLimitNotify = true // Send alert when daily limit triggers
  • [=== Trade Sequence Protection ===] InpEnableSequenceProtection = false // Enable trade sequence monitoring
  • [=== Trade Sequence Protection ===] InpSequenceUseConsecutiveSameSide = true // Use consecutive same-side trades trigger
  • [=== Trade Sequence Protection ===] InpMaxConsecutiveSameSide = 5 // Max consecutive trades in same direction (3,1,15)
  • [=== Trade Sequence Protection ===] InpSequenceUseWinRate = true // Use win-rate trigger
  • [=== Trade Sequence Protection ===] InpRequiredWinRatePercent = 40.0 // Minimum required win rate % (25.0,1.0,75.0)
  • [=== Trade Sequence Protection ===] InpWinRateMonitoringTrades = 10 // Trades to monitor for win rate (5,5,50)
  • [=== Trade Sequence Protection ===] InpPauseOnLowWinRate = true // Pause trading on low win rate
  • [=== Trade Sequence Protection ===] InpPauseDurationHours = 12 // Pause duration in hours (1,1,48)
  • [=== Market Volatility Safeguards ===] InpEnableVolatilityGuard = false // Pause during extreme volatility
  • [=== Market Volatility Safeguards ===] InpVolatilityMultiplier = 2.5 // Volatility threshold vs average (1.5,0.1,5.0)
  • [=== Market Volatility Safeguards ===] InpVolatilitySamplePeriod = 20 // Bars to measure volatility (10,5,50)
  • [=== Market Volatility Safeguards ===] InpVolatilityAdaptSlippage = true // Adjust max slippage based on volatility
  • [=== Market Volatility Safeguards ===] InpVolatilityMaxSlippageFactor = 3.0 // Maximum slippage multiplier (1.5,1.0,10.0)
  • [=== Risk Exposure Monitoring ===] InpEnableExposureLimit = false // Limit total risk exposure
  • [=== Risk Exposure Monitoring ===] InpExposureUsePositionPercent = true // Use exposure percentage limit
  • [=== Risk Exposure Monitoring ===] InpMaxPositionValuePercent = 15.0 // Max position size % of equity (5.0,1.0,50.0)
  • [=== Risk Exposure Monitoring ===] InpExposureUseEquityRatio = false // Use equity/balance ratio floor
  • [=== Risk Exposure Monitoring ===] InpEquityToBalanceMinRatio = 0.95 // Min equity/balance ratio (0.80,0.50,1.0)
  • [=== Risk Exposure Monitoring ===] InpReducePositionSizeOnDrawdown = false // Reduce position sizing during drawdown
  • [=== Risk Exposure Monitoring ===] InpPositionSizeReduceFactor = 0.5 // Position size reduction factor (0.5,0.1,0.9)
  • [=== Recovery Mode Settings ===] InpEnableRecoveryMode = false // Use recovery after drawdown
  • [=== Recovery Mode Settings ===] InpRecoveryStartPercent = 10.0 // Drawdown % to activate recovery (5.0,1.0,25.0)
  • [=== Recovery Mode Settings ===] InpRecoveryLotMultiplier = 0.5 // Position size reduction factor (0.5,0.1,1.0)
  • [=== Recovery Mode Settings ===] InpRecoverySuccessTrades = 3 // Profitable trades to exit recovery (2,1,10)
  • [=== Recovery Mode Settings ===] InpRecoveryReduceRisk = true // Use tighter stops in recovery mode
  • [=== Connection & Execution Monitoring ===] InpEnableConnectionMonitor = false // Monitor connection stability
  • [=== Connection & Execution Monitoring ===] InpMaxExecutionTimeMS = 1000 // Max execution time in ms (500,100,5000)
  • [=== Connection & Execution Monitoring ===] InpMaxOrderRetries = 3 // Max order retries on failure (2,1,10)
  • [=== Connection & Execution Monitoring ===] InpOrderRetryDelayMS = 1000 // Delay between retries in ms (500,100,5000)
  • [=== Connection & Execution Monitoring ===] InpForceCloseOnTimeout = true // Close positions on persistent timeouts
  • [=== Diagnostics & Debugging ===] InpEnableDebugTree = false // Enable tree-style debug logging
  • [=== Diagnostics & Debugging ===] InpDebugTreeIncludeTimestamp = true // Include timestamps in debug output
  • [=== Separator ===] InpmainSignal = "=== Main Signal ===" // Section header for inputs
  • [=== Exit Strategy Coordination ===] InpUseExitConsensus = true // Use coordinated exit consensus
  • [=== Exit Strategy Coordination ===] InpEnableProfitConsensus = true // Require consensus for profitable exits
  • [=== Exit Strategy Coordination ===] InpMinExitsAgreeProfit = 1 // Min exits agreeing to close profitable (1,1,7)
  • [=== Exit Strategy Coordination ===] InpEnableLossConsensus = true // Require agreement for loss exits
  • [=== Exit Strategy Coordination ===] InpMinExitsAgreeLoss = 1 // Min exits agreeing to close losing (1,1,7)
  • [=== Exit Strategy Coordination ===] InpExitConsensusProfitThreshold = 45.0 // Min profit (points) for consensus exit (0.0,1.0,100.0)
  • [=== Exit Strategy Coordination ===] InpAllowIndividualExits = false // Allow individual strategies to exit independently
  • [=== Exit Strategy Coordination ===] InpIndividualExitsProfitOnly = false // Individual exits require profit
  • [=== Exit Strategy Coordination ===] InpIndividualExitMinProfit = 30.0 // Min profit for individual exit (0.0,1.0,100.0)
  • [=== Signal Entry Settings ===] InpSignalBarShift = 1 // Signal bar shift (0=current,1=closed)
  • [=== Signal Entry Settings ===] InpMinIndicatorsAgreeForInitialTrades = 2 // Minimum Hulls agreeing for initial entries (1,1,4)
  • [=== Signal Entry Settings ===] InpMinIndicatorsAgreeForAdditonalTrades = 1 // Minimum Hulls agreeing for additional entries (1,1,4)
  • [=== Signal Stability ===] InpRequireStableSignal = true // Require consensus to persist
  • [=== Signal Stability ===] InpStableBarsRequired = 2 // Consecutive bars with same consensus (1,1,10)
  • [=== Hull 1 Inputs ===] Hull1_Enabled = true // Enable Hull 1
  • [=== Hull 1 Inputs ===] Hull1_Period = 65 // Hull period (2,1,600)
  • [=== Hull 1 Inputs ===] Hull1_Divisor = 16.5 // Hull divisor ("speed")
  • [=== Hull 1 Inputs ===] Hull1_Price = 7 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // Applied price
  • [=== Hull 1 Inputs ===] Hull1_Timeframe = 1 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Evaluation timeframe (PERIOD_CURRENT=chart)
  • [=== Hull 3 Inputs ===] Hull3_Enabled = true // Enable Hull 3
  • [=== Hull 3 Inputs ===] Hull3_Period = 48 // Hull Period (9,1,600)
  • [=== Hull 3 Inputs ===] Hull3_Divisor = 6.2 // Hull Divisor (2.0,0.1,25.0)
  • [=== Hull 3 Inputs ===] Hull3_Price = 5 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted)
  • [=== Hull 3 Inputs ===] Hull3_Timeframe = 7 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
  • [=== Hull 3 Inputs ===] Hull3_FlatSensitivity = 2.5 // Flat Sensitivity (1.0,0.5,40.0)
  • [=== Hull 3 Inputs ===] Hull3_FlatBars = 1 // Flat Bars (1,1,20)
  • [=== Hull 3 Inputs ===] Hull3_AdxTimeframe = 5 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
  • [=== Hull 3 Inputs ===] Hull3_AdxPeriod = 101 // ADX Period (7,1,100)
  • [=== Hull 3 Inputs ===] Hull3_AdxThreshold = 84.0 // ADX Threshold (20.0,0.5,80.0)
  • [=== Hull 3 Inputs ===] Hull3_MomentumLookback = 40 // Momentum Lookback (3,1,50)
  • [=== Hull 3 Inputs ===] Hull3_MomentumPoints = 12.0 // Momentum Points (5.0,0.5,100.0)
  • [=== Hull 4 Inputs ===] Hull4_Enabled = true // Enable Hull 4
  • [=== Hull 4 Inputs ===] Hull4_Period = 185 // Hull Period (9,1,1000)
  • [=== Hull 4 Inputs ===] Hull4_Divisor = 13.4 // Hull Divisor (1.0,0.1,40.0)
  • [=== Hull 4 Inputs ===] Hull4_Price = 3 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted)
  • [=== Hull 4 Inputs ===] Hull4_Timeframe = 7 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
  • [=== Hull 4 Inputs ===] Hull4_FlatSensitivity = 6.0 // Flat Sensitivity (1.0,0.5,40.0)
  • [=== Hull 4 Inputs ===] Hull4_FlatBars = 7 // Flat Bars (1,1,20)
  • [=== Hull 4 Inputs ===] Hull4_AdxTimeframe = 7 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
  • [=== Hull 4 Inputs ===] Hull4_AdxPeriod = 116 // ADX Period (7,1,50)
  • [=== Hull 4 Inputs ===] Hull4_AdxThreshold = 192.0 // ADX Threshold (10.0,0.5,60.0)
  • [=== Hull 4 Inputs ===] Hull4_MomentumLookback = 20 // Momentum Lookback (3,1,50)
  • [=== Hull 4 Inputs ===] Hull4_MomentumPoints = 41.0 // Momentum Points (1.0,0.5,40.0)
  • [=== Signal Exit Settings using HULL ===] InpCloseOnOpposite = true // Close trades on opposite agreement if in profit
  • [=== Signal Exit Settings using HULL ===] InpMinIndicatorsAgreeCloseProfit = 3 // Minimum Hulls to close in profit (1,1,4)
  • [=== Signal Exit Settings using HULL ===] InpCloseProfitPoints = 80.0 // Minimum profit (points) to close on opposite (0.0,1.0,200.0)
  • [=== Signal Exit Settings using HULL ===] InpCloseOnOppositeEvenIfInLose = true // Close trades on opposite agreement even if losing
  • [=== Signal Exit Settings using HULL ===] InpMinIndicatorsAgreeCloseLoss = 4 // Minimum Hulls to close even if losing (1,1,4)
  • [=== Separator ===] InpFilters = "=== Start of Filters ===" // Section header for inputs
  • [=== RSI Confirmation ===] InpEnableRsiConfirmation = true // Require RSI confirmation for entries
  • [=== RSI Confirmation ===] InpRsiTimeframe = 0 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
  • [=== RSI Confirmation ===] InpRsiPeriod = 41 // RSI Period (5,1,30)
  • [=== RSI Confirmation ===] InpRsiPrice = 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted)
  • [=== RSI Confirmation ===] InpRsiBuyMin = 36.0 // RSI Buy Min (0.0,1.0,50.0)
  • [=== RSI Confirmation ===] InpRsiBuyMax = 70.0 // RSI Buy Max (50.0,1.0,80.0)
  • [=== RSI Confirmation ===] InpRsiSellMin = 40.0 // RSI Sell Min (20.0,1.0,50.0)
  • [=== RSI Confirmation ===] InpRsiSellMax = 53.0 // RSI Sell Max (70.0,1.0,100.0)
  • [=== HTF RSI Confirmation Filter ===] InpEnableHtfRsiFilter = false // Enable HTF RSI confirmation filter
  • [=== HTF RSI Confirmation Filter ===] InpHtfRsiUseForInitialTrades = true // Use for initial trade entries
  • [=== HTF RSI Confirmation Filter ===] InpHtfRsiUseForAdditionalTrades = false // Use for additional trades (same direction)
  • [=== HTF RSI Confirmation Filter ===] InpHtfRsiTimeframe = 8 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // HTF RSI timeframe
  • [=== HTF RSI Confirmation Filter ===] InpHtfRsiPeriod = 34 // HTF RSI Period (5,1,200)
  • [=== HTF RSI Confirmation Filter ===] InpHtfRsiPrice = 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // HTF RSI applied price
  • [=== HTF RSI Confirmation Filter ===] InpHtfRsiBuyMin = 35.0 // HTF RSI Buy Min (0.0,1.0,50.0)
  • [=== HTF RSI Confirmation Filter ===] InpHtfRsiBuyMax = 70.0 // HTF RSI Buy Max (50.0,1.0,80.0)
  • [=== HTF RSI Confirmation Filter ===] InpHtfRsiSellMin = 30.0 // HTF RSI Sell Min (20.0,1.0,50.0)
  • [=== HTF RSI Confirmation Filter ===] InpHtfRsiSellMax = 60.0 // HTF RSI Sell Max (70.0,1.0,100.0)
  • [=== MACD Confirmation Filter ===] InpEnableMacdFilter = false // Enable MACD confirmation filter
  • [=== MACD Confirmation Filter ===] InpMacdUseForInitialTrades = true // Use for initial trade entries
  • [=== MACD Confirmation Filter ===] InpMacdUseForAdditionalTrades = false // Use for additional trades
  • [=== MACD Confirmation Filter ===] InpMacdTimeframe = 8 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // MACD timeframe
  • [=== MACD Confirmation Filter ===] InpMacdFastEma = 12 // MACD Fast EMA (5,1,50)
  • [=== MACD Confirmation Filter ===] InpMacdSlowEma = 26 // MACD Slow EMA (10,1,100)
  • [=== MACD Confirmation Filter ===] InpMacdSignalPeriod = 9 // MACD Signal Period (5,1,30)
  • [=== MACD Confirmation Filter ===] InpMacdPrice = 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MACD Applied Price
  • [=== MACD Confirmation Filter ===] InpMacdRequireHistogramPositive = true // Histogram must be positive for BUY
  • [=== MACD Confirmation Filter ===] InpMacdRequireMainAboveSignal = true // Main line must be above signal for BUY
  • [=== MACD Confirmation Filter ===] InpMacdRequireZeroCross = false // Require recent zero-line cross
  • [=== MACD Confirmation Filter ===] InpMacdCrossBarsLookback = 5 // Max bars since zero cross (1,1,20)
  • [=== MACD Confirmation Filter ===] InpMacdRequireMinHistogram = false // Require minimum histogram strength
  • [=== MACD Confirmation Filter ===] InpMacdMinHistogramValue = 0.0001 // Min histogram absolute value (0.0,0.00001,0.01)
  • [=== MACD Confirmation Filter ===] InpMacdRequireIncreasingMomentum = false // Histogram must be growing
  • [=== MACD Confirmation Filter ===] InpMacdMomentumBarsCheck = 2 // Bars to check momentum growth (1,1,5)
  • [=== HTF EMA Confirmation Filter ===] InpEnableHTFEmaFilter = false // Enable HTF EMA confirmation filter
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_UseForInitialTrades = true // Use for initial trade entries
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_UseForAdditionalTrades = false // Use for additional trades (same direction)
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_Timeframe = 8 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // HTF EMA timeframe
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_FastPeriod = 21 // Fast EMA period (5,1,200)
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_SlowPeriod = 50 // Slow EMA period (10,1,500)
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_Price = 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // EMA applied price
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_Mode = HTF_EMA_ALL_ALIGNED // EMA confirmation mode
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_CrossoverBars = 5 // Max bars since crossover (1,1,20)
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_RequireMinSeparation = false // Require minimum EMA separation
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_MinSeparationPoints = 10.0 // Min separation in points (1.0,1.0,500.0)
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_RequirePriceDistance = false // Require price distance from EMAs
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_MinPriceDistancePoints = 5.0 // Min distance in points (1.0,1.0,200.0)
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_RequireSlope = false // Require EMA slope alignment
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_SlopeLookback = 3 // Bars for slope calculation (2,1,10)
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_MinSlopePoints = 1.0 // Min slope in points (0.1,0.1,50.0)
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_WaitForPullback = false // Wait for price pullback to fast EMA
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_PullbackTolerancePoints = 20.0 // Pullback tolerance in points (5.0,1.0,100.0)
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_UseAdaptiveThresholds = false // Use ATR-based adaptive thresholds
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_AdaptiveAtrPeriod = 14 // ATR period for adaptive mode (5,1,50)
  • [=== HTF EMA Confirmation Filter ===] InpHTFEma_AdaptiveMultiplier = 1.5 // Multiplier for adaptive thresholds (0.5,0.1,5.0)
  • [=== Price Action Confirmation Filter ===] InpEnablePriceActionFilter = false // Enable price action confirmation
  • [=== Price Action Confirmation Filter ===] InpPA_UseForInitialTrades = true // Use for initial trade entries
  • [=== Price Action Confirmation Filter ===] InpPA_UseForAdditionalTrades = false // Use for additional trades (same direction)
  • [=== Price Action Pattern Detection ===] InpPA_RequireEngulfing = false // Require engulfing candle pattern
  • [=== Price Action Pattern Detection ===] InpPA_RequirePinBar = false // Require pin bar/rejection pattern
  • [=== Price Action Pattern Detection ===] InpPA_PinBarWickRatio = 2.0 // Min wick/body ratio for pin bar (1.5,0.5,5.0)
  • [=== Price Action Pattern Detection ===] InpPA_RequireInsideBar = false // Require inside bar breakout
  • [=== Price Action Pattern Detection ===] InpPA_AllowAnyPattern = true // Accept trade if ANY pattern matches (vs ALL)
  • [=== Candle Body & Structure ===] InpPA_RequireBodySize = true // Require minimum candle body
  • [=== Candle Body & Structure ===] InpPA_MinBodyPercent = 50.0 // Min body % of total range (30.0,5.0,90.0)
  • [=== Candle Body & Structure ===] InpPA_BlockDoji = true // Block doji/spinning top patterns
  • [=== Candle Body & Structure ===] InpPA_DojiThreshold = 30.0 // Max body % for doji (10.0,5.0,40.0)
  • [=== Candle Body & Structure ===] InpPA_RequireCloseInDirection = true // Close must be in trade direction
  • [=== Candle Body & Structure ===] InpPA_MinClosePositionPercent = 60.0 // Min close position in range % (50.0,10.0,90.0)
  • [=== Bar Size & Momentum Requirements ===] InpPA_RequireMinBarSize = true // Require minimum bar size
  • [=== Bar Size & Momentum Requirements ===] InpPA_MinBarSizePoints = 8 // Minimum bar size in points (2,1,50)
  • [=== Bar Size & Momentum Requirements ===] InpPA_UseATRForBarSize = true // Use ATR-based dynamic sizing
  • [=== Bar Size & Momentum Requirements ===] InpPA_MinATRMultiplier = 0.3 // Min bar size as ATR multiple (0.1,0.1,2.0)
  • [=== Bar Size & Momentum Requirements ===] InpPA_ATRPeriod = 14 // ATR period for bar sizing (10,5,50)
  • [=== Directional Strength Requirements ===] InpPA_RequireConsecutiveBars = false // Require consecutive bars in direction
  • [=== Directional Strength Requirements ===] InpPA_ConsecutiveCount = 2 // Number of consecutive bars (2,1,5)
  • [=== Directional Strength Requirements ===] InpPA_RequireHigherClose = true // BUY: close > prev close | SELL: close < prev
  • [=== Directional Strength Requirements ===] InpPA_RequireHigherHigh = false // BUY: high > prev high | SELL: low < prev low
  • [=== Wick & Rejection Analysis ===] InpPA_LimitWickSize = true // Limit opposing wick size
  • [=== Wick & Rejection Analysis ===] InpPA_MaxOpposingWickPercent = 40.0 // Max opposing wick % of range (20.0,10.0,70.0)
  • [=== Wick & Rejection Analysis ===] InpPA_RequireStrongClose = true // Close in top/bottom third of bar
  • [=== Wick & Rejection Analysis ===] InpPA_StrongClosePercent = 70.0 // Min % threshold for strong close (60.0,50.0,90.0)
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpEnableMTFTrendFilter = false // Enable MTF trend alignment
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpMTFTrend_UseForInitialTrades = true // Use for initial trade entries
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpMTFTrend_UseForAdditionalTrades = false // Use for additional trades
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpMTFTrend_Timeframe1 = 8 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trend timeframe 1 (intermediate)
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpMTFTrend_Timeframe2 = 9 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trend timeframe 2 (higher)
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpMTFTrend_Timeframe3 = 10 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trend timeframe 3 (daily)
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpMTFTrend_MA1Period = 20 // TF1 MA period (10,1,200)
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpMTFTrend_MA2Period = 50 // TF2 MA period (10,1,200)
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpMTFTrend_MA3Period = 100 // TF3 MA period (10,1,200)
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpMTFTrend_MAMethod = MODE_EMA // MA calculation method
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpMTFTrend_MAPrice = 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MA applied price
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpMTFTrend_MinAligned = 2 // Min timeframes aligned (1,1,3)
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpMTFTrend_RequirePriceAbove = true // Price must be above/below all MAs
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpMTFTrend_RequireSlope = false // Require MA slope in direction
  • [=== Multi-Timeframe Trend Alignment Filter ===] InpMTFTrend_SlopeLookback = 3 // Bars for slope calculation (2,1,10)
  • [=== ADX Trend Strength Filter ===] InpEnableAdxTrendFilter = false // Enable ADX trend filter
  • [=== ADX Trend Strength Filter ===] InpAdxTrend_UseForInitialTrades = true // Use for initial trade entries
  • [=== ADX Trend Strength Filter ===] InpAdxTrend_UseForAdditionalTrades = false // Use for additional trades
  • [=== ADX Trend Strength Filter ===] InpAdxTrend_Timeframe = 8 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // ADX timeframe
  • [=== ADX Trend Strength Filter ===] InpAdxTrend_Period = 14 // ADX period (7,1,50)
  • [=== ADX Trend Strength Filter ===] InpAdxTrend_MinStrength = 25.0 // Min ADX value for trend (15.0,5.0,50.0)
  • [=== ADX Trend Strength Filter ===] InpAdxTrend_RequireDIAlignment = true // Require DI+/DI- directional confirmation
  • [=== ADX Trend Strength Filter ===] InpAdxTrend_MinDISeparation = 5.0 // Min DI+/DI- separation (0.0,1.0,20.0)
  • [=== ADX Trend Strength Filter ===] InpAdxTrend_RequireRising = false // Require ADX to be rising (strengthening trend)
  • [=== ADX Trend Strength Filter ===] InpAdxTrend_RisingBars = 2 // Bars to confirm ADX rise (1,1,5)
  • [=== Supertrend Filter ===] InpEnableSupertrendFilter = false // Enable Supertrend filter
  • [=== Supertrend Filter ===] InpSupertrend_UseForInitialTrades = true // Use for initial trade entries
  • [=== Supertrend Filter ===] InpSupertrend_UseForAdditionalTrades = false // Use for additional trades
  • [=== Supertrend Filter ===] InpSupertrend_Timeframe = 8 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Supertrend timeframe
  • [=== Supertrend Filter ===] InpSupertrend_Period = 10 // ATR period (7,1,50)
  • [=== Supertrend Filter ===] InpSupertrend_Multiplier = 3.0 // ATR multiplier (1.0,0.5,10.0)
  • [=== Supertrend Filter ===] InpSupertrend_RequireConsecutiveBars = false // Require X bars in same trend state
  • [=== Supertrend Filter ===] InpSupertrend_ConsecutiveCount = 2 // Consecutive bars required (1,1,5)
  • [=== Ichimoku Cloud Filter ===] InpEnableIchimokuFilter = false // Enable Ichimoku filter
  • [=== Ichimoku Cloud Filter ===] InpIchimoku_UseForInitialTrades = true // Use for initial trade entries
  • [=== Ichimoku Cloud Filter ===] InpIchimoku_UseForAdditionalTrades = false // Use for additional trades
  • [=== Ichimoku Cloud Filter ===] InpIchimoku_Timeframe = 8 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Ichimoku timeframe
  • [=== Ichimoku Cloud Filter ===] InpIchimoku_TenkanPeriod = 9 // Tenkan-sen period (5,1,20)
  • [=== Ichimoku Cloud Filter ===] InpIchimoku_KijunPeriod = 26 // Kijun-sen period (10,1,50)
  • [=== Ichimoku Cloud Filter ===] InpIchimoku_SenkouPeriodB = 52 // Senkou Span B period (20,1,100)
  • [=== Ichimoku Cloud Filter ===] InpIchimoku_RequireAboveCloud = true // BUY: price above cloud, SELL: below
  • [=== Ichimoku Cloud Filter ===] InpIchimoku_RequireTKCross = false // Require Tenkan/Kijun crossover
  • [=== Ichimoku Cloud Filter ===] InpIchimoku_CrossLookback = 5 // Max bars since TK cross (1,1,20)
  • [=== Ichimoku Cloud Filter ===] InpIchimoku_RequireChikouClear = true // Chikou must be clear (not in price)
  • [=== VWAP Institutional Filter ===] InpEnableVwapFilter = false // Enable VWAP filter
  • [=== VWAP Institutional Filter ===] InpVwap_UseForInitialTrades = true // Use for initial trade entries
  • [=== VWAP Institutional Filter ===] InpVwap_UseForAdditionalTrades = false // Use for additional trades
  • [=== VWAP Institutional Filter ===] InpVwap_Timeframe = 8 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // VWAP timeframe
  • [=== VWAP Institutional Filter ===] InpVwap_Period = 20 // VWAP period (10,1,100)
  • [=== VWAP Institutional Filter ===] InpVwap_RequirePriceAbove = true // BUY: price > VWAP, SELL: price < VWAP
  • [=== VWAP Institutional Filter ===] InpVwap_RequireSlope = true // VWAP must slope in trade direction
  • [=== VWAP Institutional Filter ===] InpVwap_SlopeLookback = 3 // Bars for slope calculation (2,1,10)
  • [=== VWAP Institutional Filter ===] InpVwap_RequireMinDistance = false // Require min distance from VWAP
  • [=== VWAP Institutional Filter ===] InpVwap_MinDistancePoints = 5.0 // Min distance in points (1.0,1.0,100.0)
  • [=== Market Correlation Monitor ===] InpEnableCorrelationMonitor = true // Enable correlation monitoring
  • [=== Market Correlation Monitor ===] InpCorrelationBlockEntries = true // Block new entries on correlation breakdown
  • [=== Market Correlation Monitor ===] InpCorrelationClosePositions = false // Close positions when correlation breaks down
  • [=== Market Correlation Monitor ===] InpCorrelationTimeframe = 8 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Correlation timeframe
  • [=== Market Correlation Monitor ===] InpCorrelationLookback = 35 // Bars to evaluate correlation (10,1,500)
  • [=== Market Correlation Monitor ===] InpCorrelationMinThreshold = 3.975 // Minimum absolute correlation allowed (0.1,0.01,0.99)
  • [=== Market Correlation Monitor ===] InpCorrelationDivergenceTrigger = 0.25 // Minimum change to flag breakdown (0.05,0.01,1.0)
  • [=== Market Correlation Monitor ===] InpCorrelationConfirmBars = 1 // Consecutive bars required to confirm breakdown (1,1,10)
  • [=== Market Correlation Monitor ===] InpCorrelationSymbolSuffix = "m" // Broker symbol suffix (auto-appended)
  • [=== Market Correlation Monitor ===] InpCorrWatch_EURUSD = false // Monitor EURUSD correlation
  • [=== Market Correlation Monitor ===] InpCorrWatch_GBPUSD = false // Monitor GBPUSD correlation
  • [=== Market Correlation Monitor ===] InpCorrWatch_AUDUSD = false // Monitor AUDUSD correlation
  • [=== Market Correlation Monitor ===] InpCorrWatch_NZDUSD = false // Monitor NZDUSD correlation
  • [=== Market Correlation Monitor ===] InpCorrWatch_USDJPY = true // Monitor USDJPY correlation
  • [=== Market Correlation Monitor ===] InpCorrWatch_USDCAD = false // Monitor USDCAD correlation
  • [=== Market Correlation Monitor ===] InpCorrWatch_USDCHF = true // Monitor USDCHF correlation
  • [=== Market Correlation Monitor ===] InpCorrWatch_XAUUSD = false // Monitor XAUUSD correlation
  • [=== Bar Range Filter ===] InpEnableBarRangeFilter = false // Require minimum average bar range
  • [=== Bar Range Filter ===] InpBarRangeLookback = 5 // Number of bars to average (2,1,50)
  • [=== Bar Range Filter ===] InpMinBarRangePoints = 50.0 // Minimum average range (points) (1.0,1.0,1000.0)
  • [=== News Filter (First Friday NFP) ===] InpEnableNFPFilter = true // Block trading on first Friday (NFP)
  • [=== News Filter (First Friday NFP) ===] InpNFPStartHour = 8 // NFP release hour (broker time) (0,1,23)
  • [=== News Filter (First Friday NFP) ===] InpNFPStartMinute = 30 // NFP release minute (0,1,59)
  • [=== News Filter (First Friday NFP) ===] InpNFPAvoidMinutesBefore = 30 // Stop trading X min before NFP (5,1,120)
  • [=== News Filter (First Friday NFP) ===] InpNFPAvoidMinutesAfter = 30 // Resume trading X min after NFP (5,1,120)
  • [=== News Filter (First Friday NFP) ===] InpNFPClosePositions = false // Close positions before NFP
  • [=== News Filter (First Friday NFP) ===] InpNFPCloseMinutesBefore = 10 // Close X min before NFP (1,1,60)
  • [=== News Filter (First Friday NFP) ===] InpNFPCloseProfitOnly = true // Only close profitable positions
  • [=== Event Pause Filter ===] InpEnableEventPauseFilter = false // Enable CSV-driven event blackout
  • [=== Event Pause Filter ===] InpEventPauseCsvFile = "USDJPY.csv" // CSV filename located in MQL5\Files
  • [=== Event Pause Filter ===] InpEventPauseReloadMinutes = 60 // Reload CSV every N minutes (0=load once)
  • [=== Event Pause Filter ===] InpEventPauseLeadMinutes = 15 // Start blocking N minutes before pause window
  • [=== Event Pause Filter ===] InpEventPauseLagMinutes = 15 // Continue blocking N minutes after pause window
  • [=== Event Pause Filter ===] InpEventPauseDefaultYear = 0 // Override year if CSV omits it (0=auto)
  • [=== Event Pause Filter ===] InpEventPauseSymbolKey = "USDJPY" // Symbol keyword to match events
  • [=== Volatility Filter ===] InpEnableAtrFilter = true // Require minimum ATR
  • [=== Volatility Filter ===] InpAtrTimeframe = 6 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
  • [=== Volatility Filter ===] InpAtrPeriod = 60 // ATR period (5,1,50)
  • [=== Volatility Filter ===] InpAtrAveragePeriod = 185 // ATR average period (10,1,200)
  • [=== Volatility Filter ===] InpAtrMultiplierMin = 0.69 // ATR must be >= average*multiplier (0.5,0.1,5.0)
  • [=== Spread Filter ===] InpEnableSpreadFilter = true // Block trades during wide spreads
  • [=== Spread Filter ===] InpMaxSpreadPoints = 20.0 // Maximum allowed spread (points) (1.0,1.0,200.0)
  • [=== Volume Filter ===] InpEnableVolumeFilter = true // Enable volume filter for entries
  • [=== Volume Filter ===] InpVolumeType = VOLUME_TICK // Volume type to analyze
  • [=== Volume Filter ===] InpVolumeTimeframe = 7 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Volume data timeframe
  • [=== Volume Filter ===] InpVolumeThreshold = 0 // Minimum volume threshold (0=disabled)
  • [=== Volume Filter ===] InpUseVolumeAverage = true // Compare to average volume
  • [=== Volume Filter ===] InpVolumeAvgPeriod = 10 // Volume average period (5,1,100)
  • [=== Volume Filter ===] InpVolumeMultiplier = 0.65 // Volume must be >= average*multiplier (0.1,0.1,5.0)
  • [=== Trading Sessions Control ===] InpEnableSessionFilters = true // Enable session-based trading
  • [=== Trading Sessions Control ===] InpUseServerTime = true // Use broker server time (vs local)
  • [=== Trading Sessions Control ===] InpTesterIgnoreMarketClosures = true // Ignore market closure guards while running in Strategy Tester
  • [=== Trading Sessions Control ===] InpAsianSessionEnabled = true // Enable trading during Asian session
  • [=== Trading Sessions Control ===] InpAsianSessionStartHour = 4 // Asian session start hour (0,1,23)
  • [=== Trading Sessions Control ===] InpAsianSessionStartMinute = 20 // Asian session start minute (0,1,59)
  • [=== Trading Sessions Control ===] InpAsianSessionEndHour = 19 // Asian session end hour (0,1,23)
  • [=== Trading Sessions Control ===] InpAsianSessionEndMinute = 40 // Asian session end minute (0,1,59)
  • [=== Trading Sessions Control ===] InpEuropeanSessionEnabled = true // Enable trading during European session
  • [=== Trading Sessions Control ===] InpEuropeanSessionStartHour = 4 // European session start hour (0,1,23)
  • [=== Trading Sessions Control ===] InpEuropeanSessionStartMinute = 0 // European session start minute (0,1,59)
  • [=== Trading Sessions Control ===] InpEuropeanSessionEndHour = 17 // European session end hour (0,1,23)
  • [=== Trading Sessions Control ===] InpEuropeanSessionEndMinute = 0 // European session end minute (0,1,59)
  • [=== Trading Sessions Control ===] InpUSSessionEnabled = true // Enable trading during US session
  • [=== Trading Sessions Control ===] InpUSSessionStartHour = 0 // US session start hour (0,1,23)
  • [=== Trading Sessions Control ===] InpUSSessionStartMinute = 0 // US session start minute (0,1,59)
  • [=== Trading Sessions Control ===] InpUSSessionEndHour = 10 // US session end hour (0,1,23)
  • [=== Trading Sessions Control ===] InpUSSessionEndMinute = 0 // US session end minute (0,1,59)
  • [=== Trading Sessions Control ===] InpCustomSessionEnabled = false // Enable trading during custom session
  • [=== Trading Sessions Control ===] InpCustomSessionStartHour = 22 // Custom session start hour (0,1,23)
  • [=== Trading Sessions Control ===] InpCustomSessionStartMinute = 0 // Custom session start minute (0,1,59)
  • [=== Trading Sessions Control ===] InpCustomSessionEndHour = 23 // Custom session end hour (0,1,23)
  • [=== Trading Sessions Control ===] InpCustomSessionEndMinute = 59 // Custom session end minute (0,1,59)
  • [=== Trading Sessions Control ===] InpEnableEndOfDayClose = false // Close all trades at specific time
  • [=== Trading Sessions Control ===] InpEndOfDayCloseHour = 23 // Close hour (0,1,23)
  • [=== Trading Sessions Control ===] InpEndOfDayCloseMinute = 45 // Close minute (0,1,59)
  • [=== Trading Sessions Control ===] InpEndOfDayProfitOnly = false // Only close profitable positions
  • [=== Trading Sessions Control ===] InpEndOfDayBlockNewTrades = true // Block new trades after close time
  • [=== Choppiness Filter (Market Quality) ===] InpEnableChoppinessFilter = true // Enable choppiness detection and filtering
  • [=== Choppiness Filter (Market Quality) ===] InpChopRequireLayers = 1 // Layers required to confirm choppiness (1,1,4)
  • [=== Layer 1: Choppiness Index Settings ===] InpChopUseChopIndex = false // Enable Choppiness Index layer
  • [=== Layer 1: Choppiness Index Settings ===] InpChopIndexTimeframe = 0 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // CHOP indicator timeframe
  • [=== Layer 1: Choppiness Index Settings ===] InpChopIndexPeriod = 134 // CHOP calculation period (10,1,50)
  • [=== Layer 1: Choppiness Index Settings ===] InpChopIndexThreshold = 52.5 // Choppy when CHOP > threshold (50.0,1.0,80.0)
  • [=== Layer 2: ADX Trend Strength Settings ===] InpChopUseAdx = false // Enable ADX trend strength layer
  • [=== Layer 2: ADX Trend Strength Settings ===] InpChopAdxTimeframe = 0 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // ADX timeframe
  • [=== Layer 2: ADX Trend Strength Settings ===] InpChopAdxPeriod = 45 // ADX period (7,1,50)
  • [=== Layer 2: ADX Trend Strength Settings ===] InpChopAdxMinTrend = 82.5 // Choppy when ADX < threshold (15.0,1.0,40.0)
  • [=== Layer 3: Range Compression Settings ===] InpChopUseRangeCompression = true // Enable range compression detection
  • [=== Layer 3: Range Compression Settings ===] InpChopRangeTimeframe = 7 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Range compression timeframe
  • [=== Layer 3: Range Compression Settings ===] InpChopRangeLookback = 18 // Bars to compare range compression (3,1,20)
  • [=== Layer 3: Range Compression Settings ===] InpChopRangeAtrPeriod = 28 // ATR period for range comparison (10,1,50)
  • [=== Layer 3: Range Compression Settings ===] InpChopRangeCompressionRatio = 0.75 // Choppy when range < ATR*ratio (0.2,0.1,1.0)
  • [=== Layer 4: Adaptive Volatility Threshold Settings ===] InpChopUseAdaptiveThresholds = false // Dynamically adjust thresholds based on volatility
  • [=== Layer 4: Adaptive Volatility Threshold Settings ===] InpChopAdaptiveAtrPeriod = 50 // ATR period for adaptive scaling (20,1,100)
  • [=== Layer 4: Adaptive Volatility Threshold Settings ===] InpChopAdaptiveMultiplier = 1.5 // Volatility multiplier for adaptive mode (0.5,0.1,3.0)
  • [=== Separator ===] InpENDOFFILTERS = "=== END OF Filters ===" // Section header for inputs
  • [=== Separator ===] InpExitSectionHeader = "=== EXIT STRATEGIES ===" // Section header for inputs
  • [=== Profit Scaling Exit ===] InpEnableProfitScaling = false // Enable partial profit taking
  • [=== Profit Scaling Exit ===] InpScalingLevels = 3 // Number of scaling levels (1,1,5)
  • [=== Profit Scaling Exit ===] InpScalingTargets = "50,100,200" // Profit targets (points), comma-separated
  • [=== Profit Scaling Exit ===] InpScalingPercents = "30,30,40" // % to close at each level
  • [=== Position Time Management ===] InpEnableMaxHoldingTime = false // Enable position time limits
  • [=== Position Time Management ===] InpMaxHoldingHours = 14 // Maximum holding time (hours) (1,1,240)
  • [=== Position Time Management ===] InpCloseProfitableOnly = true // Close only profitable positions
  • [=== Position Time Management ===] InpMinProfitThreshold = 0.0 // Profit threshold (points) (0.0,1.0,500.0)
  • [=== Momentum Exit ===] InpEnableMomentumExit = false // Exit on momentum loss
  • [=== Momentum Exit ===] InpMomTimeframe = 7 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
  • [=== Momentum Exit ===] InpMomRsiPeriod = 124 // RSI period for momentum exit (5,1,30)
  • [=== Momentum Exit ===] InpMomRsiOverbought = 70.0 // RSI exit for buys (60.0,1.0,100.0)
  • [=== Momentum Exit ===] InpMomRsiOversold = 40.0 // RSI exit for sells (0.0,1.0,40.0)
  • [=== Momentum Exit ===] InpMomAdxPeriod = 14 // ADX period for exit (7,1,30)
  • [=== Momentum Exit ===] InpMomAdxWeakThreshold = 0.0 // Exit when ADX drops below (5.0,1.0,40.0)
  • [=== Volatility Spike Exit ===] InpEnableVolatilityExit = false // Exit on ATR spike
  • [=== Volatility Spike Exit ===] InpVolExitAtrTimeframe = 0 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
  • [=== Volatility Spike Exit ===] InpVolExitAtrPeriod = 79 // ATR period (5,1,50)
  • [=== Volatility Spike Exit ===] InpVolExitAtrAvgPeriod = 25 // ATR average period (10,1,200)
  • [=== Volatility Spike Exit ===] InpVolSpikeMultiplier = 1.8 // ATR spike threshold vs avg (1.0,0.1,10.0)
  • [=== Volatility Spike Exit ===] InpVolExitProfitOnly = true // Require profit before ATR spike exit
  • [=== S/R Exit ===] InpEnableSRExit = false // Exit at key levels
  • [=== S/R Exit ===] InpSRLookbackBars = 50 // Bars to find swing points (5,1,500)
  • [=== S/R Exit ===] InpSRDistancePoints = 20.0 // Distance to trigger exit (1.0,1.0,1000.0)
  • [=== S/R Exit ===] InpSRExitProfitOnly = false // Only if profitable
  • [=== CCI Exhaustion Exit ===] InpEnableCCIExit = true // Enable CCI exhaustion exit
  • [=== CCI Exhaustion Exit ===] InpCCITimeframe = 5 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // CCI timeframe
  • [=== CCI Exhaustion Exit ===] InpCCIPeriod = 28 // CCI period (10,1,50)
  • [=== CCI Exhaustion Exit ===] InpCCIPrice = 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // CCI applied price
  • [=== CCI Exhaustion Exit ===] InpCCIOverbought = 345.0 // Overbought level (100.0,10.0,300.0)
  • [=== CCI Exhaustion Exit ===] InpCCIOversold = -585.0 // Oversold level (-300.0,10.0,-100.0)
  • [=== CCI Exhaustion Exit ===] InpCCIUseDivergence = true // Detect divergence
  • [=== CCI Exhaustion Exit ===] InpCCIDivergenceBars = 32 // Divergence lookback bars (3,1,20)
  • [=== CCI Exhaustion Exit ===] InpCCICloseProfit = true // Close profitable positions
  • [=== CCI Exhaustion Exit ===] InpCCICloseLoss = false // Close losing positions too
  • [=== CCI Exhaustion Exit ===] InpCCIMinProfitPoints = 51.0 // Min profit to close (0.0,1.0,100.0)
  • [=== MACD Histogram Slope Exit ===] InpEnableMACDSlopeExit = false // Enable MACD slope exit
  • [=== MACD Histogram Slope Exit ===] InpMACDTimeframe = 0 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // MACD timeframe
  • [=== MACD Histogram Slope Exit ===] InpMACDFastEMA = 12 // Fast EMA (5,1,50)
  • [=== MACD Histogram Slope Exit ===] InpMACDSlowEMA = 26 // Slow EMA (10,1,100)
  • [=== MACD Histogram Slope Exit ===] InpMACDSignal = 9 // Signal line (5,1,20)
  • [=== MACD Histogram Slope Exit ===] g_InpMacdPrice = 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MACD applied price
  • [=== MACD Histogram Slope Exit ===] InpMACDWatchHistogram = true // Monitor histogram slope
  • [=== MACD Histogram Slope Exit ===] InpMACDSlopeBars = 2 // Bars for slope calculation (1,1,5)
  • [=== MACD Histogram Slope Exit ===] InpMACDWaitZeroCross = false // Wait for zero line cross
  • [=== MACD Histogram Slope Exit ===] InpMACDCloseProfit = true // Close profitable positions
  • [=== MACD Histogram Slope Exit ===] InpMACDCloseLoss = false // Close losing positions too
  • [=== MACD Histogram Slope Exit ===] InpMACDMinProfitPoints = 5.0 // Min profit to close (0.0,1.0,100.0)
  • [=== MACD Histogram Slope Exit ===] InpMACDMinSlopeThreshold = 0.0001 // Min histogram change (0.0,0.00001,0.001)
  • [=== Swing Reversal Exit ===] InpEnableSwingExit = false // Enable swing reversal exit
  • [=== Swing Reversal Exit ===] InpSwingLeftBars = 3 // Left bars for swing (2,1,10)
  • [=== Swing Reversal Exit ===] InpSwingRightBars = 2 // Right bars for swing (1,1,10)
  • [=== Swing Reversal Exit ===] InpSwingMinSize = 20.0 // Min swing size points (5.0,1.0,100.0)
  • [=== Swing Reversal Exit ===] InpSwingPartialClose = true // Close half positions first
  • [=== Swing Reversal Exit ===] InpSwingCloseProfit = true // Close profitable positions
  • [=== Swing Reversal Exit ===] InpSwingCloseLoss = false // Close losing positions too
  • [=== Swing Reversal Exit ===] InpSwingMinProfitPoints = 15.0 // Min profit to close (0.0,1.0,100.0)
  • [=== Swing Reversal Exit ===] InpSwingMaxAge = 3 // Max bars ago for swing (1,1,10)
  • [=== Stochastic Momentum Exit ===] InpEnableStochExit = true // Enable stochastic exit
  • [=== Stochastic Momentum Exit ===] InpStochTimeframe = 5 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Stochastic timeframe
  • [=== Stochastic Momentum Exit ===] InpStochKPeriod = 47 // %K period (5,1,50)
  • [=== Stochastic Momentum Exit ===] InpStochDPeriod = 27 // %D period (2,1,20)
  • [=== Stochastic Momentum Exit ===] InpStochSlowing = 23 // Slowing (1,1,10)
  • [=== Stochastic Momentum Exit ===] InpStochOverbought = 512.0 // Overbought (70.0,5.0,100.0)
  • [=== Stochastic Momentum Exit ===] InpStochOversold = 110.0 // Oversold (0.0,5.0,30.0)
  • [=== Stochastic Momentum Exit ===] InpStochWaitCross = true // Wait for %K/%D crossover
  • [=== Stochastic Momentum Exit ===] InpStochCloseProfit = false // Close profitable positions
  • [=== Stochastic Momentum Exit ===] InpStochCloseLoss = true // Close losing positions too
  • [=== Stochastic Momentum Exit ===] InpStochMinProfitPoints = 26.0 // Min profit to close (0.0,1.0,100.0)
  • [=== Rate of Change (ROC) Exit ===] InpEnableROCExit = false // Enable ROC momentum exit
  • [=== Rate of Change (ROC) Exit ===] InpROCTimeframe = 0 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // ROC timeframe
  • [=== Rate of Change (ROC) Exit ===] InpROCPeriod = 12 // ROC lookback period (5,1,50)
  • [=== Rate of Change (ROC) Exit ===] InpROCThreshold = 0.5 // Min ROC to stay in (0.0,0.1,5.0)
  • [=== Rate of Change (ROC) Exit ===] InpROCWeakBars = 2 // Consecutive weak bars (1,1,5)
  • [=== Rate of Change (ROC) Exit ===] InpROCCloseNewest = false // Close newest positions first
  • [=== Rate of Change (ROC) Exit ===] InpROCCloseProfit = true // Close profitable positions
  • [=== Rate of Change (ROC) Exit ===] InpROCCloseLoss = false // Close losing positions too
  • [=== Rate of Change (ROC) Exit ===] InpROCMinProfitPoints = 0.0 // Min profit to close (0.0,1.0,100.0)
  • [=== Multi-Timeframe Alignment Exit ===] InpEnableMTFExit = false // Enable MTF trend exit
  • [=== Multi-Timeframe Alignment Exit ===] InpMTFTimeframe = 8 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Higher timeframe to monitor
  • [=== Multi-Timeframe Alignment Exit ===] InpMTFMAPeriod = 50 // MA period for trend (20,1,200)
  • [=== Multi-Timeframe Alignment Exit ===] InpMTFMAMethod = MODE_EMA // MA method
  • [=== Multi-Timeframe Alignment Exit ===] InpMTFCloseOnCross = true // Close when price crosses MA
  • [=== Multi-Timeframe Alignment Exit ===] InpMTFPartialExit = true // Close oldest 50% first
  • [=== Multi-Timeframe Alignment Exit ===] InpMTFCloseProfit = true // Close profitable positions
  • [=== Multi-Timeframe Alignment Exit ===] InpMTFCloseLoss = false // Close losing positions too
  • [=== Multi-Timeframe Alignment Exit ===] InpMTFMinProfitPoints = 20.0 // Min profit to close (0.0,1.0,100.0)
  • [=== Parabolic SAR Exit ===] InpEnableSARExit = false // Enable SAR flip exit
  • [=== Parabolic SAR Exit ===] InpSARTimeframe = 0 // Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // SAR timeframe
  • [=== Parabolic SAR Exit ===] InpSARStep = 0.02 // SAR step (0.01,0.001,0.1)
  • [=== Parabolic SAR Exit ===] InpSARMaximum = 0.2 // SAR maximum (0.1,0.01,0.5)
  • [=== Parabolic SAR Exit ===] InpSARCloseAll = true // Close all positions on flip
  • [=== Parabolic SAR Exit ===] InpSARCloseProfit = true // Close profitable positions
  • [=== Parabolic SAR Exit ===] InpSARCloseLoss = false // Close losing positions too
  • [=== Parabolic SAR Exit ===] InpSARMinProfitPoints = 0.0 // Min profit to close (0.0,1.0,100.0)
  • [=== Separator ===] InpExitSectionHeaderEND = "=== END OF EXIT STRATEGIES ===" // Section header for inputs
  • [=== Separator ===] InputDashboardSectionHeader = "=== DASHBOARD AND Visualization ===" // Section header for inputs
  • [=== Dashboard Settings ===] InpShowDashboard = false // Display on-chart dashboard
  • [=== Dashboard Settings ===] InpDashboardX = 8 // Dashboard X position (pixels)
  • [=== Dashboard Settings ===] InpDashboardY = 28 // Dashboard Y position (pixels)
  • [=== Dashboard Settings ===] InpDashboardWidth = 360 // Dashboard width (pixels)
  • [=== Dashboard Settings ===] InpDashboardBgColor = (color)525572 // Dashboard background color
  • [=== Dashboard Settings ===] InpDashboardBgOpacity = 245 // Dashboard fill opacity (0 transparent, 255 solid) (0,1,255)
  • [=== Dashboard Settings ===] InpDashboardTextColor = (color)16777215 // Dashboard text color
  • [=== Dashboard Settings ===] InpDashboardAccentColor = (color)16748574 // Dashboard header/accent color
  • [=== Chart Visualization ===] InpAttachHullIndicators = false // Show Hull indicator overlays on chart
  • [=== Chart Visualization ===] InpHullIndicatorSubwindow = 1 // Subwindow index for Hull overlays (0=main chart, 1+=subwindows)
  • [=== Chart Visualization ===] InpShowRsiIndicator = false // Display RSI indicator visualization
  • [=== Chart Visualization ===] InpRsiIndicatorSubwindow = 2 // Subwindow index for RSI visualization (1+=subwindows)
  • [=== Chart Visualization ===] InpShowAdxIndicator = false // Display ADX indicator visualization
  • [=== Chart Visualization ===] InpAdxIndicatorSubwindow = 3 // Subwindow index for ADX visualization (1+=subwindows)
  • [=== Chart Visualization ===] InpShowAtrIndicator = false // Display ATR indicator visualization
  • [=== Chart Visualization ===] InpAtrIndicatorSubwindow = 4 // Subwindow index for ATR visualization (1+=subwindows)
Pseudocode
// Pipsgrowth EX16104 Trend — Execution Flow (from source analysis)
// Family: Trend
// Expert Advisor that trades using four Hull V7 indicators with advanced exit strategies and multi-layer risk management. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester

ON_INIT:
    Create indicator handles: tfRsiHandle, tfEmaFastHandle, tfEmaSlowHandle
    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 an H4 or Daily chart for best results
  7. 7Configure EMA periods, ADX threshold, and lot size in the dialog
  8. 8Enable Allow Algo Trading and click OK

EA Parameters

ParameterDefaultDescription
InpLots0.10Fixed lot size (0.01,0.01,50.0)
InpSlippagePoints20Max slippage (points) (0,1,100)
InpMagicNumber22216104Magic number (1,1,99999999)
InpTradeComment"Psgrowth.com Expert_16104"Trade comment for new positions
InpMoneyManagementModeMM_MODE_PERCENT_RISKMoney management mode
InpRiskPerTradePercent5.5Risk per trade (% of balance) (0.1,0.1,10.0)
InpLotRoundingModeLOT_ROUND_NEARESTLot rounding mode
InpStopLossPoints200.0Initial stop loss (points) (10.0,1.0,5000.0)
InpTakeProfitPoints2000.0Initial take profit (points) (10.0,1.0,10000.0)
InpEnableMarginGuardtrueEnforce minimum margin level before new trades
InpMinMarginLevelPerc240.0Minimum margin level (%) (100.0,1.0,1000.0)
InpEnableFreeMarginGuardfalseEnforce minimum free margin before new trades
InpMinFreeMarginCurrency0.0Minimum free margin (account currency)
InpEnableTrailingStoptrueMaster toggle for trailing stop management
InpTrailingTriggerPts550.0Trailing stop trigger (points) (5.0,1.0,500.0)
InpTrailingStepPts20.0Trailing stop step (points) (10.0,1.0,2000.0)
InpEnableBreakEventrueMove SL to break-even
InpBreakEvenTrigger288.0Profit trigger (points) (5.0,1.0,500.0)
InpBreakEvenOffset35.0Offset from entry (points) (0.0,1.0,100.0)
InpEnableProfitLockfalseLock profits
InpProfitLockIncrement500.0Lock every X points (10.0,1.0,500.0)
InpProfitLockStep20.0Distance from current price (1.0,1.0,200.0)
InpEnableProfitGatetrueRequire existing trades be in profit
InpProfitGatePoints10.0Minimum profit (points) per trade (1.0,1.0,500.0)
InpMaxOpenPositions0Maximum open positions (0=unlimited) (0,1,100)
InpEnablePermanentStopfalseEnable permanent stop (hard shutdown)
InpPermanentStopUseDrawdownPercenttrueUse drawdown % threshold for permanent stop
InpPermanentStopDrawdownPercent20.0Max drawdown % to trigger permanent stop (1.0,0.5,50.0)
InpPermanentStopUseDrawdownCurrencytrueUse drawdown currency threshold for permanent stop
InpPermanentStopDrawdownCurrency2000.0Max drawdown $ to trigger permanent stop (10.0,10.0,10000.0)
InpPermanentStopUseConsecutiveLossestrueUse consecutive loss threshold for permanent stop
InpPermanentStopConsecutiveLosses10Max consecutive losses to trigger permanent stop (1,1,20)
InpPermanentStopCloseAlltrueClose all positions on permanent stop
InpPermanentStopNotifytrueSend alert on permanent stop
InpEnableTemporaryPausefalseEnable temporary pause (recoverable)
InpPauseUseDrawdownPercenttrueUse drawdown % trigger for temporary pause
InpPauseDrawdownPercent10.0Drawdown % to trigger pause (1.0,0.5,50.0)
InpPauseUseDrawdownCurrencytrueUse drawdown currency trigger for temporary pause
InpPauseDrawdownCurrency1000.0Drawdown $ to trigger pause (10.0,10.0,10000.0)
InpPauseUseConsecutiveLossestrueUse consecutive loss trigger for temporary pause
InpPauseConsecutiveLosses5Consecutive losses to trigger pause (1,1,20)
InpPauseUseCooldowntrueApply cooldown timer for temporary pause
InpPauseCooldownMinutes60Cooldown period before auto-resume (0,10,1440)
InpPauseClosePositionstrueClose positions when pause triggers
InpPauseNotifytrueSend alert when pause triggers
InpEnableDailyLimitfalseEnable daily loss limit
InpDailyLimitUseCurrencytrueUse currency-based daily loss limit
InpDailyLossLimitCurrency500.0Max daily loss in account currency (50.0,10.0,10000.0)
InpDailyLimitUsePercenttrueUse percentage-based daily loss limit
InpDailyLossLimitPercent5.0Max daily loss as % of balance (0.5,0.1,25.0)
InpDailyLimitResumeNextDaytrueAuto-resume at next market day
InpDailyLimitNotifytrueSend alert when daily limit triggers
InpEnableSequenceProtectionfalseEnable trade sequence monitoring
InpSequenceUseConsecutiveSameSidetrueUse consecutive same-side trades trigger
InpMaxConsecutiveSameSide5Max consecutive trades in same direction (3,1,15)
InpSequenceUseWinRatetrueUse win-rate trigger
InpRequiredWinRatePercent40.0Minimum required win rate % (25.0,1.0,75.0)
InpWinRateMonitoringTrades10Trades to monitor for win rate (5,5,50)
InpPauseOnLowWinRatetruePause trading on low win rate
InpPauseDurationHours12Pause duration in hours (1,1,48)
InpEnableVolatilityGuardfalsePause during extreme volatility
InpVolatilityMultiplier2.5Volatility threshold vs average (1.5,0.1,5.0)
InpVolatilitySamplePeriod20Bars to measure volatility (10,5,50)
InpVolatilityAdaptSlippagetrueAdjust max slippage based on volatility
InpVolatilityMaxSlippageFactor3.0Maximum slippage multiplier (1.5,1.0,10.0)
InpEnableExposureLimitfalseLimit total risk exposure
InpExposureUsePositionPercenttrueUse exposure percentage limit
InpMaxPositionValuePercent15.0Max position size % of equity (5.0,1.0,50.0)
InpExposureUseEquityRatiofalseUse equity/balance ratio floor
InpEquityToBalanceMinRatio0.95Min equity/balance ratio (0.80,0.50,1.0)
InpReducePositionSizeOnDrawdownfalseReduce position sizing during drawdown
InpPositionSizeReduceFactor0.5Position size reduction factor (0.5,0.1,0.9)
InpEnableRecoveryModefalseUse recovery after drawdown
InpRecoveryStartPercent10.0Drawdown % to activate recovery (5.0,1.0,25.0)
InpRecoveryLotMultiplier0.5Position size reduction factor (0.5,0.1,1.0)
InpRecoverySuccessTrades3Profitable trades to exit recovery (2,1,10)
InpRecoveryReduceRisktrueUse tighter stops in recovery mode
InpEnableConnectionMonitorfalseMonitor connection stability
InpMaxExecutionTimeMS1000Max execution time in ms (500,100,5000)
InpMaxOrderRetries3Max order retries on failure (2,1,10)
InpOrderRetryDelayMS1000Delay between retries in ms (500,100,5000)
InpForceCloseOnTimeouttrueClose positions on persistent timeouts
InpEnableDebugTreefalseEnable tree-style debug logging
InpDebugTreeIncludeTimestamptrueInclude timestamps in debug output
InpmainSignal"=== Main Signal ==="Section header for inputs
InpUseExitConsensustrueUse coordinated exit consensus
InpEnableProfitConsensustrueRequire consensus for profitable exits
InpMinExitsAgreeProfit1Min exits agreeing to close profitable (1,1,7)
InpEnableLossConsensustrueRequire agreement for loss exits
InpMinExitsAgreeLoss1Min exits agreeing to close losing (1,1,7)
InpExitConsensusProfitThreshold45.0Min profit (points) for consensus exit (0.0,1.0,100.0)
InpAllowIndividualExitsfalseAllow individual strategies to exit independently
InpIndividualExitsProfitOnlyfalseIndividual exits require profit
InpIndividualExitMinProfit30.0Min profit for individual exit (0.0,1.0,100.0)
InpSignalBarShift1Signal bar shift (0=current,1=closed)
InpMinIndicatorsAgreeForInitialTrades2Minimum Hulls agreeing for initial entries (1,1,4)
InpMinIndicatorsAgreeForAdditonalTrades1Minimum Hulls agreeing for additional entries (1,1,4)
InpRequireStableSignaltrueRequire consensus to persist
InpStableBarsRequired2Consecutive bars with same consensus (1,1,10)
Hull1_EnabledtrueEnable Hull 1
Hull1_Period65Hull period (2,1,600)
Hull1_Divisor16.5Hull divisor ("speed")
Hull1_Price7Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // Applied price
Hull1_Timeframe1Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Evaluation timeframe (PERIOD_CURRENT=chart)
Hull3_EnabledtrueEnable Hull 3
Hull3_Period48Hull Period (9,1,600)
Hull3_Divisor6.2Hull Divisor (2.0,0.1,25.0)
Hull3_Price5Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted)
Hull3_Timeframe7Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
Hull3_FlatSensitivity2.5Flat Sensitivity (1.0,0.5,40.0)
Hull3_FlatBars1Flat Bars (1,1,20)
Hull3_AdxTimeframe5Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
Hull3_AdxPeriod101ADX Period (7,1,100)
Hull3_AdxThreshold84.0ADX Threshold (20.0,0.5,80.0)
Hull3_MomentumLookback40Momentum Lookback (3,1,50)
Hull3_MomentumPoints12.0Momentum Points (5.0,0.5,100.0)
Hull4_EnabledtrueEnable Hull 4
Hull4_Period185Hull Period (9,1,1000)
Hull4_Divisor13.4Hull Divisor (1.0,0.1,40.0)
Hull4_Price3Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted)
Hull4_Timeframe7Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
Hull4_FlatSensitivity6.0Flat Sensitivity (1.0,0.5,40.0)
Hull4_FlatBars7Flat Bars (1,1,20)
Hull4_AdxTimeframe7Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
Hull4_AdxPeriod116ADX Period (7,1,50)
Hull4_AdxThreshold192.0ADX Threshold (10.0,0.5,60.0)
Hull4_MomentumLookback20Momentum Lookback (3,1,50)
Hull4_MomentumPoints41.0Momentum Points (1.0,0.5,40.0)
InpCloseOnOppositetrueClose trades on opposite agreement if in profit
InpMinIndicatorsAgreeCloseProfit3Minimum Hulls to close in profit (1,1,4)
InpCloseProfitPoints80.0Minimum profit (points) to close on opposite (0.0,1.0,200.0)
InpCloseOnOppositeEvenIfInLosetrueClose trades on opposite agreement even if losing
InpMinIndicatorsAgreeCloseLoss4Minimum Hulls to close even if losing (1,1,4)
InpFilters"=== Start of Filters ==="Section header for inputs
InpEnableRsiConfirmationtrueRequire RSI confirmation for entries
InpRsiTimeframe0Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
InpRsiPeriod41RSI Period (5,1,30)
InpRsiPrice1Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted)
InpRsiBuyMin36.0RSI Buy Min (0.0,1.0,50.0)
InpRsiBuyMax70.0RSI Buy Max (50.0,1.0,80.0)
InpRsiSellMin40.0RSI Sell Min (20.0,1.0,50.0)
InpRsiSellMax53.0RSI Sell Max (70.0,1.0,100.0)
InpEnableHtfRsiFilterfalseEnable HTF RSI confirmation filter
InpHtfRsiUseForInitialTradestrueUse for initial trade entries
InpHtfRsiUseForAdditionalTradesfalseUse for additional trades (same direction)
InpHtfRsiTimeframe8Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // HTF RSI timeframe
InpHtfRsiPeriod34HTF RSI Period (5,1,200)
InpHtfRsiPrice1Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // HTF RSI applied price
InpHtfRsiBuyMin35.0HTF RSI Buy Min (0.0,1.0,50.0)
InpHtfRsiBuyMax70.0HTF RSI Buy Max (50.0,1.0,80.0)
InpHtfRsiSellMin30.0HTF RSI Sell Min (20.0,1.0,50.0)
InpHtfRsiSellMax60.0HTF RSI Sell Max (70.0,1.0,100.0)
InpEnableMacdFilterfalseEnable MACD confirmation filter
InpMacdUseForInitialTradestrueUse for initial trade entries
InpMacdUseForAdditionalTradesfalseUse for additional trades
InpMacdTimeframe8Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // MACD timeframe
InpMacdFastEma12MACD Fast EMA (5,1,50)
InpMacdSlowEma26MACD Slow EMA (10,1,100)
InpMacdSignalPeriod9MACD Signal Period (5,1,30)
InpMacdPrice1Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MACD Applied Price
InpMacdRequireHistogramPositivetrueHistogram must be positive for BUY
InpMacdRequireMainAboveSignaltrueMain line must be above signal for BUY
InpMacdRequireZeroCrossfalseRequire recent zero-line cross
InpMacdCrossBarsLookback5Max bars since zero cross (1,1,20)
InpMacdRequireMinHistogramfalseRequire minimum histogram strength
InpMacdMinHistogramValue0.0001Min histogram absolute value (0.0,0.00001,0.01)
InpMacdRequireIncreasingMomentumfalseHistogram must be growing
InpMacdMomentumBarsCheck2Bars to check momentum growth (1,1,5)
InpEnableHTFEmaFilterfalseEnable HTF EMA confirmation filter
InpHTFEma_UseForInitialTradestrueUse for initial trade entries
InpHTFEma_UseForAdditionalTradesfalseUse for additional trades (same direction)
InpHTFEma_Timeframe8Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // HTF EMA timeframe
InpHTFEma_FastPeriod21Fast EMA period (5,1,200)
InpHTFEma_SlowPeriod50Slow EMA period (10,1,500)
InpHTFEma_Price1Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // EMA applied price
InpHTFEma_ModeHTF_EMA_ALL_ALIGNEDEMA confirmation mode
InpHTFEma_CrossoverBars5Max bars since crossover (1,1,20)
InpHTFEma_RequireMinSeparationfalseRequire minimum EMA separation
InpHTFEma_MinSeparationPoints10.0Min separation in points (1.0,1.0,500.0)
InpHTFEma_RequirePriceDistancefalseRequire price distance from EMAs
InpHTFEma_MinPriceDistancePoints5.0Min distance in points (1.0,1.0,200.0)
InpHTFEma_RequireSlopefalseRequire EMA slope alignment
InpHTFEma_SlopeLookback3Bars for slope calculation (2,1,10)
InpHTFEma_MinSlopePoints1.0Min slope in points (0.1,0.1,50.0)
InpHTFEma_WaitForPullbackfalseWait for price pullback to fast EMA
InpHTFEma_PullbackTolerancePoints20.0Pullback tolerance in points (5.0,1.0,100.0)
InpHTFEma_UseAdaptiveThresholdsfalseUse ATR-based adaptive thresholds
InpHTFEma_AdaptiveAtrPeriod14ATR period for adaptive mode (5,1,50)
InpHTFEma_AdaptiveMultiplier1.5Multiplier for adaptive thresholds (0.5,0.1,5.0)
InpEnablePriceActionFilterfalseEnable price action confirmation
InpPA_UseForInitialTradestrueUse for initial trade entries
InpPA_UseForAdditionalTradesfalseUse for additional trades (same direction)
InpPA_RequireEngulfingfalseRequire engulfing candle pattern
InpPA_RequirePinBarfalseRequire pin bar/rejection pattern
InpPA_PinBarWickRatio2.0Min wick/body ratio for pin bar (1.5,0.5,5.0)
InpPA_RequireInsideBarfalseRequire inside bar breakout
InpPA_AllowAnyPatterntrueAccept trade if ANY pattern matches (vs ALL)
InpPA_RequireBodySizetrueRequire minimum candle body
InpPA_MinBodyPercent50.0Min body % of total range (30.0,5.0,90.0)
InpPA_BlockDojitrueBlock doji/spinning top patterns
InpPA_DojiThreshold30.0Max body % for doji (10.0,5.0,40.0)
InpPA_RequireCloseInDirectiontrueClose must be in trade direction
InpPA_MinClosePositionPercent60.0Min close position in range % (50.0,10.0,90.0)
InpPA_RequireMinBarSizetrueRequire minimum bar size
InpPA_MinBarSizePoints8Minimum bar size in points (2,1,50)
InpPA_UseATRForBarSizetrueUse ATR-based dynamic sizing
InpPA_MinATRMultiplier0.3Min bar size as ATR multiple (0.1,0.1,2.0)
InpPA_ATRPeriod14ATR period for bar sizing (10,5,50)
InpPA_RequireConsecutiveBarsfalseRequire consecutive bars in direction
InpPA_ConsecutiveCount2Number of consecutive bars (2,1,5)
InpPA_RequireHigherClosetrueBUY: close > prev close | SELL: close < prev
InpPA_RequireHigherHighfalseBUY: high > prev high | SELL: low < prev low
InpPA_LimitWickSizetrueLimit opposing wick size
InpPA_MaxOpposingWickPercent40.0Max opposing wick % of range (20.0,10.0,70.0)
InpPA_RequireStrongClosetrueClose in top/bottom third of bar
InpPA_StrongClosePercent70.0Min % threshold for strong close (60.0,50.0,90.0)
InpEnableMTFTrendFilterfalseEnable MTF trend alignment
InpMTFTrend_UseForInitialTradestrueUse for initial trade entries
InpMTFTrend_UseForAdditionalTradesfalseUse for additional trades
InpMTFTrend_Timeframe18Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trend timeframe 1 (intermediate)
InpMTFTrend_Timeframe29Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trend timeframe 2 (higher)
InpMTFTrend_Timeframe310Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trend timeframe 3 (daily)
InpMTFTrend_MA1Period20TF1 MA period (10,1,200)
InpMTFTrend_MA2Period50TF2 MA period (10,1,200)
InpMTFTrend_MA3Period100TF3 MA period (10,1,200)
InpMTFTrend_MAMethodMODE_EMAMA calculation method
InpMTFTrend_MAPrice1Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MA applied price
InpMTFTrend_MinAligned2Min timeframes aligned (1,1,3)
InpMTFTrend_RequirePriceAbovetruePrice must be above/below all MAs
InpMTFTrend_RequireSlopefalseRequire MA slope in direction
InpMTFTrend_SlopeLookback3Bars for slope calculation (2,1,10)
InpEnableAdxTrendFilterfalseEnable ADX trend filter
InpAdxTrend_UseForInitialTradestrueUse for initial trade entries
InpAdxTrend_UseForAdditionalTradesfalseUse for additional trades
InpAdxTrend_Timeframe8Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // ADX timeframe
InpAdxTrend_Period14ADX period (7,1,50)
InpAdxTrend_MinStrength25.0Min ADX value for trend (15.0,5.0,50.0)
InpAdxTrend_RequireDIAlignmenttrueRequire DI+/DI- directional confirmation
InpAdxTrend_MinDISeparation5.0Min DI+/DI- separation (0.0,1.0,20.0)
InpAdxTrend_RequireRisingfalseRequire ADX to be rising (strengthening trend)
InpAdxTrend_RisingBars2Bars to confirm ADX rise (1,1,5)
InpEnableSupertrendFilterfalseEnable Supertrend filter
InpSupertrend_UseForInitialTradestrueUse for initial trade entries
InpSupertrend_UseForAdditionalTradesfalseUse for additional trades
InpSupertrend_Timeframe8Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Supertrend timeframe
InpSupertrend_Period10ATR period (7,1,50)
InpSupertrend_Multiplier3.0ATR multiplier (1.0,0.5,10.0)
InpSupertrend_RequireConsecutiveBarsfalseRequire X bars in same trend state
InpSupertrend_ConsecutiveCount2Consecutive bars required (1,1,5)
InpEnableIchimokuFilterfalseEnable Ichimoku filter
InpIchimoku_UseForInitialTradestrueUse for initial trade entries
InpIchimoku_UseForAdditionalTradesfalseUse for additional trades
InpIchimoku_Timeframe8Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Ichimoku timeframe
InpIchimoku_TenkanPeriod9Tenkan-sen period (5,1,20)
InpIchimoku_KijunPeriod26Kijun-sen period (10,1,50)
InpIchimoku_SenkouPeriodB52Senkou Span B period (20,1,100)
InpIchimoku_RequireAboveCloudtrueBUY: price above cloud, SELL: below
InpIchimoku_RequireTKCrossfalseRequire Tenkan/Kijun crossover
InpIchimoku_CrossLookback5Max bars since TK cross (1,1,20)
InpIchimoku_RequireChikouCleartrueChikou must be clear (not in price)
InpEnableVwapFilterfalseEnable VWAP filter
InpVwap_UseForInitialTradestrueUse for initial trade entries
InpVwap_UseForAdditionalTradesfalseUse for additional trades
InpVwap_Timeframe8Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // VWAP timeframe
InpVwap_Period20VWAP period (10,1,100)
InpVwap_RequirePriceAbovetrueBUY: price > VWAP, SELL: price < VWAP
InpVwap_RequireSlopetrueVWAP must slope in trade direction
InpVwap_SlopeLookback3Bars for slope calculation (2,1,10)
InpVwap_RequireMinDistancefalseRequire min distance from VWAP
InpVwap_MinDistancePoints5.0Min distance in points (1.0,1.0,100.0)
InpEnableCorrelationMonitortrueEnable correlation monitoring
InpCorrelationBlockEntriestrueBlock new entries on correlation breakdown
InpCorrelationClosePositionsfalseClose positions when correlation breaks down
InpCorrelationTimeframe8Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Correlation timeframe
InpCorrelationLookback35Bars to evaluate correlation (10,1,500)
InpCorrelationMinThreshold3.975Minimum absolute correlation allowed (0.1,0.01,0.99)
InpCorrelationDivergenceTrigger0.25Minimum change to flag breakdown (0.05,0.01,1.0)
InpCorrelationConfirmBars1Consecutive bars required to confirm breakdown (1,1,10)
InpCorrelationSymbolSuffix"m"Broker symbol suffix (auto-appended)
InpCorrWatch_EURUSDfalseMonitor EURUSD correlation
InpCorrWatch_GBPUSDfalseMonitor GBPUSD correlation
InpCorrWatch_AUDUSDfalseMonitor AUDUSD correlation
InpCorrWatch_NZDUSDfalseMonitor NZDUSD correlation
InpCorrWatch_USDJPYtrueMonitor USDJPY correlation
InpCorrWatch_USDCADfalseMonitor USDCAD correlation
InpCorrWatch_USDCHFtrueMonitor USDCHF correlation
InpCorrWatch_XAUUSDfalseMonitor XAUUSD correlation
InpEnableBarRangeFilterfalseRequire minimum average bar range
InpBarRangeLookback5Number of bars to average (2,1,50)
InpMinBarRangePoints50.0Minimum average range (points) (1.0,1.0,1000.0)
InpEnableNFPFiltertrueBlock trading on first Friday (NFP)
InpNFPStartHour8NFP release hour (broker time) (0,1,23)
InpNFPStartMinute30NFP release minute (0,1,59)
InpNFPAvoidMinutesBefore30Stop trading X min before NFP (5,1,120)
InpNFPAvoidMinutesAfter30Resume trading X min after NFP (5,1,120)
InpNFPClosePositionsfalseClose positions before NFP
InpNFPCloseMinutesBefore10Close X min before NFP (1,1,60)
InpNFPCloseProfitOnlytrueOnly close profitable positions
InpEnableEventPauseFilterfalseEnable CSV-driven event blackout
InpEventPauseCsvFile"USDJPY.csv"CSV filename located in MQL5\Files
InpEventPauseReloadMinutes60Reload CSV every N minutes (0=load once)
InpEventPauseLeadMinutes15Start blocking N minutes before pause window
InpEventPauseLagMinutes15Continue blocking N minutes after pause window
InpEventPauseDefaultYear0Override year if CSV omits it (0=auto)
InpEventPauseSymbolKey"USDJPY"Symbol keyword to match events
InpEnableAtrFiltertrueRequire minimum ATR
InpAtrTimeframe6Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
InpAtrPeriod60ATR period (5,1,50)
InpAtrAveragePeriod185ATR average period (10,1,200)
InpAtrMultiplierMin0.69ATR must be >= average*multiplier (0.5,0.1,5.0)
InpEnableSpreadFiltertrueBlock trades during wide spreads
InpMaxSpreadPoints20.0Maximum allowed spread (points) (1.0,1.0,200.0)
InpEnableVolumeFiltertrueEnable volume filter for entries
InpVolumeTypeVOLUME_TICKVolume type to analyze
InpVolumeTimeframe7Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Volume data timeframe
InpVolumeThreshold0Minimum volume threshold (0=disabled)
InpUseVolumeAveragetrueCompare to average volume
InpVolumeAvgPeriod10Volume average period (5,1,100)
InpVolumeMultiplier0.65Volume must be >= average*multiplier (0.1,0.1,5.0)
InpEnableSessionFilterstrueEnable session-based trading
InpUseServerTimetrueUse broker server time (vs local)
InpTesterIgnoreMarketClosurestrueIgnore market closure guards while running in Strategy Tester
InpAsianSessionEnabledtrueEnable trading during Asian session
InpAsianSessionStartHour4Asian session start hour (0,1,23)
InpAsianSessionStartMinute20Asian session start minute (0,1,59)
InpAsianSessionEndHour19Asian session end hour (0,1,23)
InpAsianSessionEndMinute40Asian session end minute (0,1,59)
InpEuropeanSessionEnabledtrueEnable trading during European session
InpEuropeanSessionStartHour4European session start hour (0,1,23)
InpEuropeanSessionStartMinute0European session start minute (0,1,59)
InpEuropeanSessionEndHour17European session end hour (0,1,23)
InpEuropeanSessionEndMinute0European session end minute (0,1,59)
InpUSSessionEnabledtrueEnable trading during US session
InpUSSessionStartHour0US session start hour (0,1,23)
InpUSSessionStartMinute0US session start minute (0,1,59)
InpUSSessionEndHour10US session end hour (0,1,23)
InpUSSessionEndMinute0US session end minute (0,1,59)
InpCustomSessionEnabledfalseEnable trading during custom session
InpCustomSessionStartHour22Custom session start hour (0,1,23)
InpCustomSessionStartMinute0Custom session start minute (0,1,59)
InpCustomSessionEndHour23Custom session end hour (0,1,23)
InpCustomSessionEndMinute59Custom session end minute (0,1,59)
InpEnableEndOfDayClosefalseClose all trades at specific time
InpEndOfDayCloseHour23Close hour (0,1,23)
InpEndOfDayCloseMinute45Close minute (0,1,59)
InpEndOfDayProfitOnlyfalseOnly close profitable positions
InpEndOfDayBlockNewTradestrueBlock new trades after close time
InpEnableChoppinessFiltertrueEnable choppiness detection and filtering
InpChopRequireLayers1Layers required to confirm choppiness (1,1,4)
InpChopUseChopIndexfalseEnable Choppiness Index layer
InpChopIndexTimeframe0Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // CHOP indicator timeframe
InpChopIndexPeriod134CHOP calculation period (10,1,50)
InpChopIndexThreshold52.5Choppy when CHOP > threshold (50.0,1.0,80.0)
InpChopUseAdxfalseEnable ADX trend strength layer
InpChopAdxTimeframe0Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // ADX timeframe
InpChopAdxPeriod45ADX period (7,1,50)
InpChopAdxMinTrend82.5Choppy when ADX < threshold (15.0,1.0,40.0)
InpChopUseRangeCompressiontrueEnable range compression detection
InpChopRangeTimeframe7Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Range compression timeframe
InpChopRangeLookback18Bars to compare range compression (3,1,20)
InpChopRangeAtrPeriod28ATR period for range comparison (10,1,50)
InpChopRangeCompressionRatio0.75Choppy when range < ATR*ratio (0.2,0.1,1.0)
InpChopUseAdaptiveThresholdsfalseDynamically adjust thresholds based on volatility
InpChopAdaptiveAtrPeriod50ATR period for adaptive scaling (20,1,100)
InpChopAdaptiveMultiplier1.5Volatility multiplier for adaptive mode (0.5,0.1,3.0)
InpENDOFFILTERS"=== END OF Filters ==="Section header for inputs
InpExitSectionHeader"=== EXIT STRATEGIES ==="Section header for inputs
InpEnableProfitScalingfalseEnable partial profit taking
InpScalingLevels3Number of scaling levels (1,1,5)
InpScalingTargets"50,100,200"Profit targets (points), comma-separated
InpScalingPercents"30,30,40"% to close at each level
InpEnableMaxHoldingTimefalseEnable position time limits
InpMaxHoldingHours14Maximum holding time (hours) (1,1,240)
InpCloseProfitableOnlytrueClose only profitable positions
InpMinProfitThreshold0.0Profit threshold (points) (0.0,1.0,500.0)
InpEnableMomentumExitfalseExit on momentum loss
InpMomTimeframe7Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
InpMomRsiPeriod124RSI period for momentum exit (5,1,30)
InpMomRsiOverbought70.0RSI exit for buys (60.0,1.0,100.0)
InpMomRsiOversold40.0RSI exit for sells (0.0,1.0,40.0)
InpMomAdxPeriod14ADX period for exit (7,1,30)
InpMomAdxWeakThreshold0.0Exit when ADX drops below (5.0,1.0,40.0)
InpEnableVolatilityExitfalseExit on ATR spike
InpVolExitAtrTimeframe0Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1)
InpVolExitAtrPeriod79ATR period (5,1,50)
InpVolExitAtrAvgPeriod25ATR average period (10,1,200)
InpVolSpikeMultiplier1.8ATR spike threshold vs avg (1.0,0.1,10.0)
InpVolExitProfitOnlytrueRequire profit before ATR spike exit
InpEnableSRExitfalseExit at key levels
InpSRLookbackBars50Bars to find swing points (5,1,500)
InpSRDistancePoints20.0Distance to trigger exit (1.0,1.0,1000.0)
InpSRExitProfitOnlyfalseOnly if profitable
InpEnableCCIExittrueEnable CCI exhaustion exit
InpCCITimeframe5Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // CCI timeframe
InpCCIPeriod28CCI period (10,1,50)
InpCCIPrice1Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // CCI applied price
InpCCIOverbought345.0Overbought level (100.0,10.0,300.0)
InpCCIOversold-585.0Oversold level (-300.0,10.0,-100.0)
InpCCIUseDivergencetrueDetect divergence
InpCCIDivergenceBars32Divergence lookback bars (3,1,20)
InpCCICloseProfittrueClose profitable positions
InpCCICloseLossfalseClose losing positions too
InpCCIMinProfitPoints51.0Min profit to close (0.0,1.0,100.0)
InpEnableMACDSlopeExitfalseEnable MACD slope exit
InpMACDTimeframe0Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // MACD timeframe
InpMACDFastEMA12Fast EMA (5,1,50)
InpMACDSlowEMA26Slow EMA (10,1,100)
InpMACDSignal9Signal line (5,1,20)
g_InpMacdPrice1Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MACD applied price
InpMACDWatchHistogramtrueMonitor histogram slope
InpMACDSlopeBars2Bars for slope calculation (1,1,5)
InpMACDWaitZeroCrossfalseWait for zero line cross
InpMACDCloseProfittrueClose profitable positions
InpMACDCloseLossfalseClose losing positions too
InpMACDMinProfitPoints5.0Min profit to close (0.0,1.0,100.0)
InpMACDMinSlopeThreshold0.0001Min histogram change (0.0,0.00001,0.001)
InpEnableSwingExitfalseEnable swing reversal exit
InpSwingLeftBars3Left bars for swing (2,1,10)
InpSwingRightBars2Right bars for swing (1,1,10)
InpSwingMinSize20.0Min swing size points (5.0,1.0,100.0)
InpSwingPartialClosetrueClose half positions first
InpSwingCloseProfittrueClose profitable positions
InpSwingCloseLossfalseClose losing positions too
InpSwingMinProfitPoints15.0Min profit to close (0.0,1.0,100.0)
InpSwingMaxAge3Max bars ago for swing (1,1,10)
InpEnableStochExittrueEnable stochastic exit
InpStochTimeframe5Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Stochastic timeframe
InpStochKPeriod47%K period (5,1,50)
InpStochDPeriod27%D period (2,1,20)
InpStochSlowing23Slowing (1,1,10)
InpStochOverbought512.0Overbought (70.0,5.0,100.0)
InpStochOversold110.0Oversold (0.0,5.0,30.0)
InpStochWaitCrosstrueWait for %K/%D crossover
InpStochCloseProfitfalseClose profitable positions
InpStochCloseLosstrueClose losing positions too
InpStochMinProfitPoints26.0Min profit to close (0.0,1.0,100.0)
InpEnableROCExitfalseEnable ROC momentum exit
InpROCTimeframe0Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // ROC timeframe
InpROCPeriod12ROC lookback period (5,1,50)
InpROCThreshold0.5Min ROC to stay in (0.0,0.1,5.0)
InpROCWeakBars2Consecutive weak bars (1,1,5)
InpROCCloseNewestfalseClose newest positions first
InpROCCloseProfittrueClose profitable positions
InpROCCloseLossfalseClose losing positions too
InpROCMinProfitPoints0.0Min profit to close (0.0,1.0,100.0)
InpEnableMTFExitfalseEnable MTF trend exit
InpMTFTimeframe8Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Higher timeframe to monitor
InpMTFMAPeriod50MA period for trend (20,1,200)
InpMTFMAMethodMODE_EMAMA method
InpMTFCloseOnCrosstrueClose when price crosses MA
InpMTFPartialExittrueClose oldest 50% first
InpMTFCloseProfittrueClose profitable positions
InpMTFCloseLossfalseClose losing positions too
InpMTFMinProfitPoints20.0Min profit to close (0.0,1.0,100.0)
InpEnableSARExitfalseEnable SAR flip exit
InpSARTimeframe0Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // SAR timeframe
InpSARStep0.02SAR step (0.01,0.001,0.1)
InpSARMaximum0.2SAR maximum (0.1,0.01,0.5)
InpSARCloseAlltrueClose all positions on flip
InpSARCloseProfittrueClose profitable positions
InpSARCloseLossfalseClose losing positions too
InpSARMinProfitPoints0.0Min profit to close (0.0,1.0,100.0)
InpExitSectionHeaderEND"=== END OF EXIT STRATEGIES ==="Section header for inputs
InputDashboardSectionHeader"=== DASHBOARD AND Visualization ==="Section header for inputs
InpShowDashboardfalseDisplay on-chart dashboard
InpDashboardX8Dashboard X position (pixels)
InpDashboardY28Dashboard Y position (pixels)
InpDashboardWidth360Dashboard width (pixels)
InpDashboardBgColor(color)525572Dashboard background color
InpDashboardBgOpacity245Dashboard fill opacity (0 transparent, 255 solid) (0,1,255)
InpDashboardTextColor(color)16777215Dashboard text color
InpDashboardAccentColor(color)16748574Dashboard header/accent color
InpAttachHullIndicatorsfalseShow Hull indicator overlays on chart
InpHullIndicatorSubwindow1Subwindow index for Hull overlays (0=main chart, 1+=subwindows)
InpShowRsiIndicatorfalseDisplay RSI indicator visualization
InpRsiIndicatorSubwindow2Subwindow index for RSI visualization (1+=subwindows)
InpShowAdxIndicatorfalseDisplay ADX indicator visualization
InpAdxIndicatorSubwindow3Subwindow index for ADX visualization (1+=subwindows)
InpShowAtrIndicatorfalseDisplay ATR indicator visualization
InpAtrIndicatorSubwindow4Subwindow index for ATR visualization (1+=subwindows)
Source Code (.mq5)Open Source
Pipsgrowth_com_EX16104.mq5
#property copyright "Pipsgrowth.com"
#property link      "https://pipsgrowth.com"
#property version   "2.00"
#property strict
#property description "Pipsgrowth.com EX16104 Hull2EA — four Hull V7 indicator trend EA with advanced exits, full 12-layer stack."

#include <Trade/Trade.mqh>
#include <Trade/PositionInfo.mqh>

//+------------------------------------------------------------------+
//| Internal Hull V7 Calculator Class                                |
//+------------------------------------------------------------------+
class CHullV7Calculator
{
private:
   string             m_symbol;
   ENUM_TIMEFRAMES    m_timeframe;
   int                m_period;
   double             m_divisor;
   ENUM_APPLIED_PRICE m_price;
   double             m_flatSensitivity;
   int                m_flatBars;
   bool               m_useAdx;
   int                m_adxHandle;
   double             m_adxThreshold;
   
   double CalculateWMA(const double &price[], int n, int shift)
   {
      if(n <= 0) return 0.0;
      double sum = 0.0;
      double weightSum = 0.0;
      int size = ArraySize(price);
      
      for(int i = 0; i < n; i++)
      {
         int idx = shift + i;
         if(idx >= size) break;
         
         double w = (double)(n - i);
         sum += price[idx] * w;
         weightSum += w;
      }
      return (weightSum > 0.0) ? sum / weightSum : 0.0;
   }

public:
   CHullV7Calculator() : m_adxHandle(INVALID_HANDLE) {}
   ~CHullV7Calculator() 
   { 
      if(m_adxHandle != INVALID_HANDLE) 
         IndicatorRelease(m_adxHandle); 
   }

   bool Init(string symbol, int period, double divisor, ENUM_APPLIED_PRICE price,
             ENUM_TIMEFRAMES timeframe, double flatSensitivity, int flatBars,
             bool useAdx, ENUM_TIMEFRAMES adxTf, int adxPer, double adxThresh)
   {
      m_symbol = symbol;
      m_period = period;
      m_divisor = divisor;

Full source code available on download

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

Tags:ex16104trendpipsgrowthfreemt5xauusd

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_EX16104.mq5
File Size599.6 KB
Versionv2.00
PlatformMetaTrader 5
File Type.mq5 Source
StrategyTrend Following
Risk LevelMedium Risk
Timeframes
M5H1
Currency Pairs
XAUUSD
Min. Deposit$100