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.
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 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.
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.
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.
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:
tfRsiHandletfEmaFastHandletfEmaSlowHandle
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 marginlevelbefore new trades - [=== Risk Management ===]
InpMinMarginLevelPerc=240.0// Minimum marginlevel(%) (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// HullDivisor(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// FlatSensitivity(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 //
ADXPeriod(7,1,100) - [=== Hull 3 Inputs ===] Hull3_AdxThreshold =
84.0//ADXThreshold(20.0,0.5,80.0) - [=== Hull 3 Inputs ===] Hull3_MomentumLookback = 40 // Momentum
Lookback(3,1,50) - [=== Hull 3 Inputs ===] Hull3_MomentumPoints =
12.0// MomentumPoints(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// HullDivisor(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// FlatSensitivity(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 //
ADXPeriod(7,1,50) - [=== Hull 4 Inputs ===] Hull4_AdxThreshold =
192.0//ADXThreshold(10.0,0.5,60.0) - [=== Hull 4 Inputs ===] Hull4_MomentumLookback = 20 // Momentum
Lookback(3,1,50) - [=== Hull 4 Inputs ===] Hull4_MomentumPoints =
41.0// MomentumPoints(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 - [===
RSIConfirmation ===]InpEnableRsiConfirmation=true// RequireRSIconfirmation for entries - [===
RSIConfirmation ===]InpRsiTimeframe= 0 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) - [===
RSIConfirmation ===]InpRsiPeriod= 41 //RSIPeriod(5,1,30) - [===
RSIConfirmation ===]InpRsiPrice= 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) - [===
RSIConfirmation ===]InpRsiBuyMin=36.0//RSIBuyMin(0.0,1.0,50.0) - [===
RSIConfirmation ===]InpRsiBuyMax=70.0//RSIBuyMax(50.0,1.0,80.0) - [===
RSIConfirmation ===]InpRsiSellMin=40.0//RSISellMin(20.0,1.0,50.0) - [===
RSIConfirmation ===]InpRsiSellMax=53.0//RSISellMax(70.0,1.0,100.0) - [===
HTFRSIConfirmation Filter ===]InpEnableHtfRsiFilter=false// EnableHTFRSIconfirmation filter - [===
HTFRSIConfirmation Filter ===]InpHtfRsiUseForInitialTrades=true// Use for initial trade entries - [===
HTFRSIConfirmation Filter ===]InpHtfRsiUseForAdditionalTrades=false// Use for additional trades (same direction) - [===
HTFRSIConfirmation Filter ===]InpHtfRsiTimeframe= 8 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //HTFRSItimeframe - [===
HTFRSIConfirmation Filter ===]InpHtfRsiPeriod= 34 //HTFRSIPeriod(5,1,200) - [===
HTFRSIConfirmation Filter ===]InpHtfRsiPrice= 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) //HTFRSIapplied price - [===
HTFRSIConfirmation Filter ===]InpHtfRsiBuyMin=35.0//HTFRSIBuyMin(0.0,1.0,50.0) - [===
HTFRSIConfirmation Filter ===]InpHtfRsiBuyMax=70.0//HTFRSIBuyMax(50.0,1.0,80.0) - [===
HTFRSIConfirmation Filter ===]InpHtfRsiSellMin=30.0//HTFRSISellMin(20.0,1.0,50.0) - [===
HTFRSIConfirmation Filter ===]InpHtfRsiSellMax=60.0//HTFRSISellMax(70.0,1.0,100.0) - [===
MACDConfirmation Filter ===]InpEnableMacdFilter=false// EnableMACDconfirmation filter - [===
MACDConfirmation Filter ===]InpMacdUseForInitialTrades=true// Use for initial trade entries - [===
MACDConfirmation Filter ===]InpMacdUseForAdditionalTrades=false// Use for additional trades - [===
MACDConfirmation Filter ===]InpMacdTimeframe= 8 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //MACDtimeframe - [===
MACDConfirmation Filter ===]InpMacdFastEma= 12 //MACDFastEMA(5,1,50) - [===
MACDConfirmation Filter ===]InpMacdSlowEma= 26 //MACDSlowEMA(10,1,100) - [===
MACDConfirmation Filter ===]InpMacdSignalPeriod= 9 //MACDSignalPeriod(5,1,30) - [===
MACDConfirmation Filter ===]InpMacdPrice= 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) //MACDApplied Price - [===
MACDConfirmation Filter ===]InpMacdRequireHistogramPositive=true// Histogram must be positive forBUY - [===
MACDConfirmation Filter ===]InpMacdRequireMainAboveSignal=true// Main line must be above signal forBUY - [===
MACDConfirmation Filter ===]InpMacdRequireZeroCross=false// Require recent zero-line cross - [===
MACDConfirmation Filter ===]InpMacdCrossBarsLookback= 5 // Max bars since zero cross (1,1,20) - [===
MACDConfirmation Filter ===]InpMacdRequireMinHistogram=false// Require minimum histogram strength - [===
MACDConfirmation Filter ===]InpMacdMinHistogramValue=0.0001// Min histogram absolute value (0.0,0.00001,0.01) - [===
MACDConfirmation Filter ===]InpMacdRequireIncreasingMomentum=false// Histogram must be growing - [===
MACDConfirmation Filter ===]InpMacdMomentumBarsCheck= 2 // Bars to check momentum growth (1,1,5) - [===
HTFEMAConfirmation Filter ===]InpEnableHTFEmaFilter=false// EnableHTFEMAconfirmation filter - [===
HTFEMAConfirmation Filter ===]InpHTFEma_UseForInitialTrades=true// Use for initial trade entries - [===
HTFEMAConfirmation Filter ===]InpHTFEma_UseForAdditionalTrades=false// Use for additional trades (same direction) - [===
HTFEMAConfirmation Filter ===]InpHTFEma_Timeframe= 8 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //HTFEMAtimeframe - [===
HTFEMAConfirmation Filter ===]InpHTFEma_FastPeriod= 21 // FastEMAperiod (5,1,200) - [===
HTFEMAConfirmation Filter ===]InpHTFEma_SlowPeriod= 50 // SlowEMAperiod (10,1,500) - [===
HTFEMAConfirmation Filter ===]InpHTFEma_Price= 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) //EMAapplied price - [===
HTFEMAConfirmation Filter ===]InpHTFEma_Mode=HTF_EMA_ALL_ALIGNED//EMAconfirmation mode - [===
HTFEMAConfirmation Filter ===]InpHTFEma_CrossoverBars= 5 // Max bars since crossover (1,1,20) - [===
HTFEMAConfirmation Filter ===]InpHTFEma_RequireMinSeparation=false// Require minimumEMAseparation - [===
HTFEMAConfirmation Filter ===]InpHTFEma_MinSeparationPoints=10.0// Min separation in points (1.0,1.0,500.0) - [===
HTFEMAConfirmation Filter ===]InpHTFEma_RequirePriceDistance=false// Require price distance fromEMAs - [===
HTFEMAConfirmation Filter ===]InpHTFEma_MinPriceDistancePoints=5.0// Min distance in points (1.0,1.0,200.0) - [===
HTFEMAConfirmation Filter ===]InpHTFEma_RequireSlope=false// RequireEMAslope alignment - [===
HTFEMAConfirmation Filter ===]InpHTFEma_SlopeLookback= 3 // Bars for slope calculation (2,1,10) - [===
HTFEMAConfirmation Filter ===]InpHTFEma_MinSlopePoints=1.0// Min slope in points (0.1,0.1,50.0) - [===
HTFEMAConfirmation Filter ===]InpHTFEma_WaitForPullback=false// Wait for price pullback to fastEMA - [===
HTFEMAConfirmation Filter ===]InpHTFEma_PullbackTolerancePoints=20.0// Pullback tolerance in points (5.0,1.0,100.0) - [===
HTFEMAConfirmation Filter ===]InpHTFEma_UseAdaptiveThresholds=false// UseATR-based adaptive thresholds - [===
HTFEMAConfirmation Filter ===]InpHTFEma_AdaptiveAtrPeriod= 14 //ATRperiod for adaptive mode (5,1,50) - [===
HTFEMAConfirmation 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// UseATR-based dynamic sizing - [=== Bar Size & Momentum Requirements ===]
InpPA_MinATRMultiplier=0.3// Min bar size asATRmultiple (0.1,0.1,2.0) - [=== Bar Size & Momentum Requirements ===]
InpPA_ATRPeriod= 14 //ATRperiod 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// EnableMTFtrend 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 //TF1MA period (10,1,200) - [=== Multi-Timeframe Trend Alignment Filter ===]
InpMTFTrend_MA2Period= 50 //TF2MA period (10,1,200) - [=== Multi-Timeframe Trend Alignment Filter ===]
InpMTFTrend_MA3Period= 100 //TF3MA 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) - [===
ADXTrend Strength Filter ===]InpEnableAdxTrendFilter=false// EnableADXtrend filter - [===
ADXTrend Strength Filter ===]InpAdxTrend_UseForInitialTrades=true// Use for initial trade entries - [===
ADXTrend Strength Filter ===]InpAdxTrend_UseForAdditionalTrades=false// Use for additional trades - [===
ADXTrend Strength Filter ===]InpAdxTrend_Timeframe= 8 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //ADXtimeframe - [===
ADXTrend Strength Filter ===]InpAdxTrend_Period= 14 //ADXperiod (7,1,50) - [===
ADXTrend Strength Filter ===]InpAdxTrend_MinStrength=25.0// MinADXvalue for trend (15.0,5.0,50.0) - [===
ADXTrend Strength Filter ===]InpAdxTrend_RequireDIAlignment=true// Require DI+/DI- directional confirmation - [===
ADXTrend Strength Filter ===]InpAdxTrend_MinDISeparation=5.0// Min DI+/DI- separation (0.0,1.0,20.0) - [===
ADXTrend Strength Filter ===]InpAdxTrend_RequireRising=false// RequireADXto be rising (strengthening trend) - [===
ADXTrend Strength Filter ===]InpAdxTrend_RisingBars= 2 // Bars to confirmADXrise (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 //ATRperiod (7,1,50) - [=== Supertrend Filter ===]
InpSupertrend_Multiplier=3.0//ATRmultiplier (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) - [===
VWAPInstitutional Filter ===]InpEnableVwapFilter=false// EnableVWAPfilter - [===
VWAPInstitutional Filter ===]InpVwap_UseForInitialTrades=true// Use for initial trade entries - [===
VWAPInstitutional Filter ===]InpVwap_UseForAdditionalTrades=false// Use for additional trades - [===
VWAPInstitutional Filter ===]InpVwap_Timeframe= 8 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //VWAPtimeframe - [===
VWAPInstitutional Filter ===]InpVwap_Period= 20 //VWAPperiod (10,1,100) - [===
VWAPInstitutional Filter ===]InpVwap_RequirePriceAbove=true//BUY: price >VWAP,SELL: price <VWAP - [===
VWAPInstitutional Filter ===]InpVwap_RequireSlope=true//VWAPmust slope in trade direction - [===
VWAPInstitutional Filter ===]InpVwap_SlopeLookback= 3 // Bars for slope calculation (2,1,10) - [===
VWAPInstitutional Filter ===]InpVwap_RequireMinDistance=false// Require min distance fromVWAP - [===
VWAPInstitutional 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// MonitorEURUSDcorrelation - [=== Market Correlation Monitor ===]
InpCorrWatch_GBPUSD=false// MonitorGBPUSDcorrelation - [=== Market Correlation Monitor ===]
InpCorrWatch_AUDUSD=false// MonitorAUDUSDcorrelation - [=== Market Correlation Monitor ===]
InpCorrWatch_NZDUSD=false// MonitorNZDUSDcorrelation - [=== Market Correlation Monitor ===]
InpCorrWatch_USDJPY=true// MonitorUSDJPYcorrelation - [=== Market Correlation Monitor ===]
InpCorrWatch_USDCAD=false// MonitorUSDCADcorrelation - [=== Market Correlation Monitor ===]
InpCorrWatch_USDCHF=true// MonitorUSDCHFcorrelation - [=== Market Correlation Monitor ===]
InpCorrWatch_XAUUSD=false// MonitorXAUUSDcorrelation - [=== 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 FridayNFP) ===]InpEnableNFPFilter=true// Block trading on firstFriday(NFP) - [=== News
Filter(First FridayNFP) ===]InpNFPStartHour= 8 //NFPrelease hour (broker time) (0,1,23) - [=== News
Filter(First FridayNFP) ===]InpNFPStartMinute= 30 //NFPrelease minute (0,1,59) - [=== News
Filter(First FridayNFP) ===]InpNFPAvoidMinutesBefore= 30 // Stop trading X min beforeNFP(5,1,120) - [=== News
Filter(First FridayNFP) ===]InpNFPAvoidMinutesAfter= 30 // Resume trading X min afterNFP(5,1,120) - [=== News
Filter(First FridayNFP) ===]InpNFPClosePositions=false// Close positions beforeNFP - [=== News
Filter(First FridayNFP) ===]InpNFPCloseMinutesBefore= 10 // Close X min beforeNFP(1,1,60) - [=== News
Filter(First FridayNFP) ===]InpNFPCloseProfitOnly=true// Only close profitable positions - [=== Event Pause Filter ===]
InpEnableEventPauseFilter=false// EnableCSV-driven event blackout - [=== Event Pause Filter ===]
InpEventPauseCsvFile= "USDJPY.csv" //CSVfilename located inMQL5\Files - [=== Event Pause Filter ===]
InpEventPauseReloadMinutes= 60 // ReloadCSVevery 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 ifCSVomits it (0=auto) - [=== Event Pause Filter ===]
InpEventPauseSymbolKey= "USDJPY" // Symbol keyword to match events - [=== Volatility Filter ===]
InpEnableAtrFilter=true// Require minimumATR - [=== Volatility Filter ===]
InpAtrTimeframe= 6 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) - [=== Volatility Filter ===]
InpAtrPeriod= 60 //ATRperiod (5,1,50) - [=== Volatility Filter ===]
InpAtrAveragePeriod= 185 //ATRaverage period (10,1,200) - [=== Volatility Filter ===]
InpAtrMultiplierMin=0.69//ATRmust 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) //CHOPindicator timeframe - [=== Layer 1: Choppiness Index Settings ===]
InpChopIndexPeriod= 134 //CHOPcalculation period (10,1,50) - [=== Layer 1: Choppiness Index Settings ===]
InpChopIndexThreshold=52.5// Choppy whenCHOP> threshold (50.0,1.0,80.0) - [=== Layer 2:
ADXTrend Strength Settings ===]InpChopUseAdx=false// EnableADXtrend strength layer - [=== Layer 2:
ADXTrend Strength Settings ===]InpChopAdxTimeframe= 0 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //ADXtimeframe - [=== Layer 2:
ADXTrend Strength Settings ===]InpChopAdxPeriod= 45 //ADXperiod (7,1,50) - [=== Layer 2:
ADXTrend Strength Settings ===]InpChopAdxMinTrend=82.5// Choppy whenADX< 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 //ATRperiod 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 //ATRperiod 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= "===ENDOF Filters ===" // Section header for inputs - [=== Separator ===]
InpExitSectionHeader= "===EXITSTRATEGIES===" // 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 eachlevel - [=== 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 //RSIperiod for momentum exit (5,1,30) - [=== Momentum Exit ===]
InpMomRsiOverbought=70.0//RSIexit for buys (60.0,1.0,100.0) - [=== Momentum Exit ===]
InpMomRsiOversold=40.0//RSIexit for sells (0.0,1.0,40.0) - [=== Momentum Exit ===]
InpMomAdxPeriod= 14 //ADXperiod for exit (7,1,30) - [=== Momentum Exit ===]
InpMomAdxWeakThreshold=0.0// Exit whenADXdrops below (5.0,1.0,40.0) - [=== Volatility Spike Exit ===]
InpEnableVolatilityExit=false// Exit onATRspike - [=== 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 //ATRperiod (5,1,50) - [=== Volatility Spike Exit ===]
InpVolExitAtrAvgPeriod= 25 //ATRaverage period (10,1,200) - [=== Volatility Spike Exit ===]
InpVolSpikeMultiplier=1.8//ATRspike threshold vs avg (1.0,0.1,10.0) - [=== Volatility Spike Exit ===]
InpVolExitProfitOnly=true// Require profit beforeATRspike 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 - [===
CCIExhaustion Exit ===]InpEnableCCIExit=true// EnableCCIexhaustion exit - [===
CCIExhaustion Exit ===]InpCCITimeframe= 5 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //CCItimeframe - [===
CCIExhaustion Exit ===]InpCCIPeriod= 28 //CCIperiod (10,1,50) - [===
CCIExhaustion Exit ===]InpCCIPrice= 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) //CCIapplied price - [===
CCIExhaustion Exit ===]InpCCIOverbought=345.0// Overboughtlevel(100.0,10.0,300.0) - [===
CCIExhaustion Exit ===]InpCCIOversold= -585.0// Oversoldlevel(-300.0,10.0,-100.0) - [===
CCIExhaustion Exit ===]InpCCIUseDivergence=true// Detect divergence - [===
CCIExhaustion Exit ===]InpCCIDivergenceBars= 32 // Divergence lookback bars (3,1,20) - [===
CCIExhaustion Exit ===]InpCCICloseProfit=true// Close profitable positions - [===
CCIExhaustion Exit ===]InpCCICloseLoss=false// Close losing positions too - [===
CCIExhaustion Exit ===]InpCCIMinProfitPoints=51.0// Min profit to close (0.0,1.0,100.0) - [===
MACDHistogram Slope Exit ===]InpEnableMACDSlopeExit=false// EnableMACDslope exit - [===
MACDHistogram Slope Exit ===]InpMACDTimeframe= 0 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //MACDtimeframe - [===
MACDHistogram Slope Exit ===]InpMACDFastEMA= 12 // FastEMA(5,1,50) - [===
MACDHistogram Slope Exit ===]InpMACDSlowEMA= 26 // SlowEMA(10,1,100) - [===
MACDHistogram Slope Exit ===]InpMACDSignal= 9 // Signal line (5,1,20) - [===
MACDHistogram Slope Exit ===]g_InpMacdPrice= 1 // Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) //MACDapplied price - [===
MACDHistogram Slope Exit ===]InpMACDWatchHistogram=true// Monitor histogram slope - [===
MACDHistogram Slope Exit ===]InpMACDSlopeBars= 2 // Bars for slope calculation (1,1,5) - [===
MACDHistogram Slope Exit ===]InpMACDWaitZeroCross=false// Wait for zero line cross - [===
MACDHistogram Slope Exit ===]InpMACDCloseProfit=true// Close profitable positions - [===
MACDHistogram Slope Exit ===]InpMACDCloseLoss=false// Close losing positions too - [===
MACDHistogram Slope Exit ===]InpMACDMinProfitPoints=5.0// Min profit to close (0.0,1.0,100.0) - [===
MACDHistogram 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// EnableROCmomentum exit - [=== Rate of
Change(ROC) Exit ===]InpROCTimeframe= 0 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //ROCtimeframe - [=== Rate of
Change(ROC) Exit ===]InpROCPeriod= 12 //ROClookback period (5,1,50) - [=== Rate of
Change(ROC) Exit ===]InpROCThreshold=0.5// MinROCto 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// EnableMTFtrend 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
SARExit ===]InpEnableSARExit=false// EnableSARflip exit - [=== Parabolic
SARExit ===]InpSARTimeframe= 0 //Timeframe(1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) //SARtimeframe - [=== Parabolic
SARExit ===]InpSARStep=0.02//SARstep (0.01,0.001,0.1) - [=== Parabolic
SARExit ===]InpSARMaximum=0.2//SARmaximum (0.1,0.01,0.5) - [=== Parabolic
SARExit ===]InpSARCloseAll=true// Close all positions on flip - [=== Parabolic
SARExit ===]InpSARCloseProfit=true// Close profitable positions - [=== Parabolic
SARExit ===]InpSARCloseLoss=false// Close losing positions too - [=== Parabolic
SARExit ===]InpSARMinProfitPoints=0.0// Min profit to close (0.0,1.0,100.0) - [=== Separator ===]
InpExitSectionHeaderEND= "===ENDOFEXITSTRATEGIES===" // Section header for inputs - [=== Separator ===]
InputDashboardSectionHeader= "===DASHBOARDAND 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// DisplayRSIindicator visualization - [=== Chart Visualization ===]
InpRsiIndicatorSubwindow= 2 // Subwindow index forRSIvisualization (1+=subwindows) - [=== Chart Visualization ===]
InpShowAdxIndicator=false// DisplayADXindicator visualization - [=== Chart Visualization ===]
InpAdxIndicatorSubwindow= 3 // Subwindow index forADXvisualization (1+=subwindows) - [=== Chart Visualization ===]
InpShowAtrIndicator=false// DisplayATRindicator visualization - [=== Chart Visualization ===]
InpAtrIndicatorSubwindow= 4 // Subwindow index forATRvisualization (1+=subwindows)
// 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
How to Install This EA on MT5
- 1Download the .mq5 file using the button above
- 2Open MetaTrader 5 on your computer
- 3Click File → Open Data Folder in the top menu
- 4Navigate to MQL5 → Experts and paste the .mq5 file there
- 5In MT5, right-click Expert Advisors in the Navigator panel → Refresh
- 6Drag the EA onto an H4 or Daily chart for best results
- 7Configure EMA periods, ADX threshold, and lot size in the dialog
- 8Enable Allow Algo Trading and click OK
EA Parameters
| Parameter | Default | Description |
|---|---|---|
| InpLots | 0.10 | Fixed lot size (0.01,0.01,50.0) |
| InpSlippagePoints | 20 | Max slippage (points) (0,1,100) |
| InpMagicNumber | 22216104 | Magic number (1,1,99999999) |
| InpTradeComment | "Psgrowth.com Expert_16104" | Trade comment for new positions |
| InpMoneyManagementMode | MM_MODE_PERCENT_RISK | Money management mode |
| InpRiskPerTradePercent | 5.5 | Risk per trade (% of balance) (0.1,0.1,10.0) |
| InpLotRoundingMode | LOT_ROUND_NEAREST | Lot rounding mode |
| InpStopLossPoints | 200.0 | Initial stop loss (points) (10.0,1.0,5000.0) |
| InpTakeProfitPoints | 2000.0 | Initial take profit (points) (10.0,1.0,10000.0) |
| InpEnableMarginGuard | true | Enforce minimum margin level before new trades |
| InpMinMarginLevelPerc | 240.0 | Minimum margin level (%) (100.0,1.0,1000.0) |
| InpEnableFreeMarginGuard | false | Enforce minimum free margin before new trades |
| InpMinFreeMarginCurrency | 0.0 | Minimum free margin (account currency) |
| InpEnableTrailingStop | true | Master toggle for trailing stop management |
| InpTrailingTriggerPts | 550.0 | Trailing stop trigger (points) (5.0,1.0,500.0) |
| InpTrailingStepPts | 20.0 | Trailing stop step (points) (10.0,1.0,2000.0) |
| InpEnableBreakEven | true | Move SL to break-even |
| InpBreakEvenTrigger | 288.0 | Profit trigger (points) (5.0,1.0,500.0) |
| InpBreakEvenOffset | 35.0 | Offset from entry (points) (0.0,1.0,100.0) |
| InpEnableProfitLock | false | Lock profits |
| InpProfitLockIncrement | 500.0 | Lock every X points (10.0,1.0,500.0) |
| InpProfitLockStep | 20.0 | Distance from current price (1.0,1.0,200.0) |
| InpEnableProfitGate | true | Require existing trades be in profit |
| InpProfitGatePoints | 10.0 | Minimum profit (points) per trade (1.0,1.0,500.0) |
| InpMaxOpenPositions | 0 | Maximum open positions (0=unlimited) (0,1,100) |
| InpEnablePermanentStop | false | Enable permanent stop (hard shutdown) |
| InpPermanentStopUseDrawdownPercent | true | Use drawdown % threshold for permanent stop |
| InpPermanentStopDrawdownPercent | 20.0 | Max drawdown % to trigger permanent stop (1.0,0.5,50.0) |
| InpPermanentStopUseDrawdownCurrency | true | Use drawdown currency threshold for permanent stop |
| InpPermanentStopDrawdownCurrency | 2000.0 | Max drawdown $ to trigger permanent stop (10.0,10.0,10000.0) |
| InpPermanentStopUseConsecutiveLosses | true | Use consecutive loss threshold for permanent stop |
| InpPermanentStopConsecutiveLosses | 10 | Max consecutive losses to trigger permanent stop (1,1,20) |
| InpPermanentStopCloseAll | true | Close all positions on permanent stop |
| InpPermanentStopNotify | true | Send alert on permanent stop |
| InpEnableTemporaryPause | false | Enable temporary pause (recoverable) |
| InpPauseUseDrawdownPercent | true | Use drawdown % trigger for temporary pause |
| InpPauseDrawdownPercent | 10.0 | Drawdown % to trigger pause (1.0,0.5,50.0) |
| InpPauseUseDrawdownCurrency | true | Use drawdown currency trigger for temporary pause |
| InpPauseDrawdownCurrency | 1000.0 | Drawdown $ to trigger pause (10.0,10.0,10000.0) |
| InpPauseUseConsecutiveLosses | true | Use consecutive loss trigger for temporary pause |
| InpPauseConsecutiveLosses | 5 | Consecutive losses to trigger pause (1,1,20) |
| InpPauseUseCooldown | true | Apply cooldown timer for temporary pause |
| InpPauseCooldownMinutes | 60 | Cooldown period before auto-resume (0,10,1440) |
| InpPauseClosePositions | true | Close positions when pause triggers |
| InpPauseNotify | true | Send alert when pause triggers |
| InpEnableDailyLimit | false | Enable daily loss limit |
| InpDailyLimitUseCurrency | true | Use currency-based daily loss limit |
| InpDailyLossLimitCurrency | 500.0 | Max daily loss in account currency (50.0,10.0,10000.0) |
| InpDailyLimitUsePercent | true | Use percentage-based daily loss limit |
| InpDailyLossLimitPercent | 5.0 | Max daily loss as % of balance (0.5,0.1,25.0) |
| InpDailyLimitResumeNextDay | true | Auto-resume at next market day |
| InpDailyLimitNotify | true | Send alert when daily limit triggers |
| InpEnableSequenceProtection | false | Enable trade sequence monitoring |
| InpSequenceUseConsecutiveSameSide | true | Use consecutive same-side trades trigger |
| InpMaxConsecutiveSameSide | 5 | Max consecutive trades in same direction (3,1,15) |
| InpSequenceUseWinRate | true | Use win-rate trigger |
| InpRequiredWinRatePercent | 40.0 | Minimum required win rate % (25.0,1.0,75.0) |
| InpWinRateMonitoringTrades | 10 | Trades to monitor for win rate (5,5,50) |
| InpPauseOnLowWinRate | true | Pause trading on low win rate |
| InpPauseDurationHours | 12 | Pause duration in hours (1,1,48) |
| InpEnableVolatilityGuard | false | Pause during extreme volatility |
| InpVolatilityMultiplier | 2.5 | Volatility threshold vs average (1.5,0.1,5.0) |
| InpVolatilitySamplePeriod | 20 | Bars to measure volatility (10,5,50) |
| InpVolatilityAdaptSlippage | true | Adjust max slippage based on volatility |
| InpVolatilityMaxSlippageFactor | 3.0 | Maximum slippage multiplier (1.5,1.0,10.0) |
| InpEnableExposureLimit | false | Limit total risk exposure |
| InpExposureUsePositionPercent | true | Use exposure percentage limit |
| InpMaxPositionValuePercent | 15.0 | Max position size % of equity (5.0,1.0,50.0) |
| InpExposureUseEquityRatio | false | Use equity/balance ratio floor |
| InpEquityToBalanceMinRatio | 0.95 | Min equity/balance ratio (0.80,0.50,1.0) |
| InpReducePositionSizeOnDrawdown | false | Reduce position sizing during drawdown |
| InpPositionSizeReduceFactor | 0.5 | Position size reduction factor (0.5,0.1,0.9) |
| InpEnableRecoveryMode | false | Use recovery after drawdown |
| InpRecoveryStartPercent | 10.0 | Drawdown % to activate recovery (5.0,1.0,25.0) |
| InpRecoveryLotMultiplier | 0.5 | Position size reduction factor (0.5,0.1,1.0) |
| InpRecoverySuccessTrades | 3 | Profitable trades to exit recovery (2,1,10) |
| InpRecoveryReduceRisk | true | Use tighter stops in recovery mode |
| InpEnableConnectionMonitor | false | Monitor connection stability |
| InpMaxExecutionTimeMS | 1000 | Max execution time in ms (500,100,5000) |
| InpMaxOrderRetries | 3 | Max order retries on failure (2,1,10) |
| InpOrderRetryDelayMS | 1000 | Delay between retries in ms (500,100,5000) |
| InpForceCloseOnTimeout | true | Close positions on persistent timeouts |
| InpEnableDebugTree | false | Enable tree-style debug logging |
| InpDebugTreeIncludeTimestamp | true | Include timestamps in debug output |
| InpmainSignal | "=== Main Signal ===" | Section header for inputs |
| InpUseExitConsensus | true | Use coordinated exit consensus |
| InpEnableProfitConsensus | true | Require consensus for profitable exits |
| InpMinExitsAgreeProfit | 1 | Min exits agreeing to close profitable (1,1,7) |
| InpEnableLossConsensus | true | Require agreement for loss exits |
| InpMinExitsAgreeLoss | 1 | Min exits agreeing to close losing (1,1,7) |
| InpExitConsensusProfitThreshold | 45.0 | Min profit (points) for consensus exit (0.0,1.0,100.0) |
| InpAllowIndividualExits | false | Allow individual strategies to exit independently |
| InpIndividualExitsProfitOnly | false | Individual exits require profit |
| InpIndividualExitMinProfit | 30.0 | Min profit for individual exit (0.0,1.0,100.0) |
| InpSignalBarShift | 1 | Signal bar shift (0=current,1=closed) |
| InpMinIndicatorsAgreeForInitialTrades | 2 | Minimum Hulls agreeing for initial entries (1,1,4) |
| InpMinIndicatorsAgreeForAdditonalTrades | 1 | Minimum Hulls agreeing for additional entries (1,1,4) |
| InpRequireStableSignal | true | Require consensus to persist |
| InpStableBarsRequired | 2 | Consecutive bars with same consensus (1,1,10) |
| Hull1_Enabled | true | Enable Hull 1 |
| Hull1_Period | 65 | Hull period (2,1,600) |
| Hull1_Divisor | 16.5 | Hull divisor ("speed") |
| Hull1_Price | 7 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // Applied price |
| Hull1_Timeframe | 1 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Evaluation timeframe (PERIOD_CURRENT=chart) |
| Hull3_Enabled | true | Enable Hull 3 |
| Hull3_Period | 48 | Hull Period (9,1,600) |
| Hull3_Divisor | 6.2 | Hull Divisor (2.0,0.1,25.0) |
| Hull3_Price | 5 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) |
| Hull3_Timeframe | 7 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) |
| Hull3_FlatSensitivity | 2.5 | Flat Sensitivity (1.0,0.5,40.0) |
| Hull3_FlatBars | 1 | Flat Bars (1,1,20) |
| Hull3_AdxTimeframe | 5 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) |
| Hull3_AdxPeriod | 101 | ADX Period (7,1,100) |
| Hull3_AdxThreshold | 84.0 | ADX Threshold (20.0,0.5,80.0) |
| Hull3_MomentumLookback | 40 | Momentum Lookback (3,1,50) |
| Hull3_MomentumPoints | 12.0 | Momentum Points (5.0,0.5,100.0) |
| Hull4_Enabled | true | Enable Hull 4 |
| Hull4_Period | 185 | Hull Period (9,1,1000) |
| Hull4_Divisor | 13.4 | Hull Divisor (1.0,0.1,40.0) |
| Hull4_Price | 3 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) |
| Hull4_Timeframe | 7 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) |
| Hull4_FlatSensitivity | 6.0 | Flat Sensitivity (1.0,0.5,40.0) |
| Hull4_FlatBars | 7 | Flat Bars (1,1,20) |
| Hull4_AdxTimeframe | 7 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) |
| Hull4_AdxPeriod | 116 | ADX Period (7,1,50) |
| Hull4_AdxThreshold | 192.0 | ADX Threshold (10.0,0.5,60.0) |
| Hull4_MomentumLookback | 20 | Momentum Lookback (3,1,50) |
| Hull4_MomentumPoints | 41.0 | Momentum Points (1.0,0.5,40.0) |
| InpCloseOnOpposite | true | Close trades on opposite agreement if in profit |
| InpMinIndicatorsAgreeCloseProfit | 3 | Minimum Hulls to close in profit (1,1,4) |
| InpCloseProfitPoints | 80.0 | Minimum profit (points) to close on opposite (0.0,1.0,200.0) |
| InpCloseOnOppositeEvenIfInLose | true | Close trades on opposite agreement even if losing |
| InpMinIndicatorsAgreeCloseLoss | 4 | Minimum Hulls to close even if losing (1,1,4) |
| InpFilters | "=== Start of Filters ===" | Section header for inputs |
| InpEnableRsiConfirmation | true | Require RSI confirmation for entries |
| InpRsiTimeframe | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) |
| InpRsiPeriod | 41 | RSI Period (5,1,30) |
| InpRsiPrice | 1 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) |
| InpRsiBuyMin | 36.0 | RSI Buy Min (0.0,1.0,50.0) |
| InpRsiBuyMax | 70.0 | RSI Buy Max (50.0,1.0,80.0) |
| InpRsiSellMin | 40.0 | RSI Sell Min (20.0,1.0,50.0) |
| InpRsiSellMax | 53.0 | RSI Sell Max (70.0,1.0,100.0) |
| InpEnableHtfRsiFilter | false | Enable HTF RSI confirmation filter |
| InpHtfRsiUseForInitialTrades | true | Use for initial trade entries |
| InpHtfRsiUseForAdditionalTrades | false | Use for additional trades (same direction) |
| InpHtfRsiTimeframe | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // HTF RSI timeframe |
| InpHtfRsiPeriod | 34 | HTF RSI Period (5,1,200) |
| InpHtfRsiPrice | 1 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // HTF RSI applied price |
| InpHtfRsiBuyMin | 35.0 | HTF RSI Buy Min (0.0,1.0,50.0) |
| InpHtfRsiBuyMax | 70.0 | HTF RSI Buy Max (50.0,1.0,80.0) |
| InpHtfRsiSellMin | 30.0 | HTF RSI Sell Min (20.0,1.0,50.0) |
| InpHtfRsiSellMax | 60.0 | HTF RSI Sell Max (70.0,1.0,100.0) |
| InpEnableMacdFilter | false | Enable MACD confirmation filter |
| InpMacdUseForInitialTrades | true | Use for initial trade entries |
| InpMacdUseForAdditionalTrades | false | Use for additional trades |
| InpMacdTimeframe | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // MACD timeframe |
| InpMacdFastEma | 12 | MACD Fast EMA (5,1,50) |
| InpMacdSlowEma | 26 | MACD Slow EMA (10,1,100) |
| InpMacdSignalPeriod | 9 | MACD Signal Period (5,1,30) |
| InpMacdPrice | 1 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MACD Applied Price |
| InpMacdRequireHistogramPositive | true | Histogram must be positive for BUY |
| InpMacdRequireMainAboveSignal | true | Main line must be above signal for BUY |
| InpMacdRequireZeroCross | false | Require recent zero-line cross |
| InpMacdCrossBarsLookback | 5 | Max bars since zero cross (1,1,20) |
| InpMacdRequireMinHistogram | false | Require minimum histogram strength |
| InpMacdMinHistogramValue | 0.0001 | Min histogram absolute value (0.0,0.00001,0.01) |
| InpMacdRequireIncreasingMomentum | false | Histogram must be growing |
| InpMacdMomentumBarsCheck | 2 | Bars to check momentum growth (1,1,5) |
| InpEnableHTFEmaFilter | false | Enable HTF EMA confirmation filter |
| InpHTFEma_UseForInitialTrades | true | Use for initial trade entries |
| InpHTFEma_UseForAdditionalTrades | false | Use for additional trades (same direction) |
| InpHTFEma_Timeframe | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // HTF EMA timeframe |
| InpHTFEma_FastPeriod | 21 | Fast EMA period (5,1,200) |
| InpHTFEma_SlowPeriod | 50 | Slow EMA period (10,1,500) |
| InpHTFEma_Price | 1 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // EMA applied price |
| InpHTFEma_Mode | HTF_EMA_ALL_ALIGNED | EMA confirmation mode |
| InpHTFEma_CrossoverBars | 5 | Max bars since crossover (1,1,20) |
| InpHTFEma_RequireMinSeparation | false | Require minimum EMA separation |
| InpHTFEma_MinSeparationPoints | 10.0 | Min separation in points (1.0,1.0,500.0) |
| InpHTFEma_RequirePriceDistance | false | Require price distance from EMAs |
| InpHTFEma_MinPriceDistancePoints | 5.0 | Min distance in points (1.0,1.0,200.0) |
| InpHTFEma_RequireSlope | false | Require EMA slope alignment |
| InpHTFEma_SlopeLookback | 3 | Bars for slope calculation (2,1,10) |
| InpHTFEma_MinSlopePoints | 1.0 | Min slope in points (0.1,0.1,50.0) |
| InpHTFEma_WaitForPullback | false | Wait for price pullback to fast EMA |
| InpHTFEma_PullbackTolerancePoints | 20.0 | Pullback tolerance in points (5.0,1.0,100.0) |
| InpHTFEma_UseAdaptiveThresholds | false | Use ATR-based adaptive thresholds |
| InpHTFEma_AdaptiveAtrPeriod | 14 | ATR period for adaptive mode (5,1,50) |
| InpHTFEma_AdaptiveMultiplier | 1.5 | Multiplier for adaptive thresholds (0.5,0.1,5.0) |
| InpEnablePriceActionFilter | false | Enable price action confirmation |
| InpPA_UseForInitialTrades | true | Use for initial trade entries |
| InpPA_UseForAdditionalTrades | false | Use for additional trades (same direction) |
| InpPA_RequireEngulfing | false | Require engulfing candle pattern |
| InpPA_RequirePinBar | false | Require pin bar/rejection pattern |
| InpPA_PinBarWickRatio | 2.0 | Min wick/body ratio for pin bar (1.5,0.5,5.0) |
| InpPA_RequireInsideBar | false | Require inside bar breakout |
| InpPA_AllowAnyPattern | true | Accept trade if ANY pattern matches (vs ALL) |
| InpPA_RequireBodySize | true | Require minimum candle body |
| InpPA_MinBodyPercent | 50.0 | Min body % of total range (30.0,5.0,90.0) |
| InpPA_BlockDoji | true | Block doji/spinning top patterns |
| InpPA_DojiThreshold | 30.0 | Max body % for doji (10.0,5.0,40.0) |
| InpPA_RequireCloseInDirection | true | Close must be in trade direction |
| InpPA_MinClosePositionPercent | 60.0 | Min close position in range % (50.0,10.0,90.0) |
| InpPA_RequireMinBarSize | true | Require minimum bar size |
| InpPA_MinBarSizePoints | 8 | Minimum bar size in points (2,1,50) |
| InpPA_UseATRForBarSize | true | Use ATR-based dynamic sizing |
| InpPA_MinATRMultiplier | 0.3 | Min bar size as ATR multiple (0.1,0.1,2.0) |
| InpPA_ATRPeriod | 14 | ATR period for bar sizing (10,5,50) |
| InpPA_RequireConsecutiveBars | false | Require consecutive bars in direction |
| InpPA_ConsecutiveCount | 2 | Number of consecutive bars (2,1,5) |
| InpPA_RequireHigherClose | true | BUY: close > prev close | SELL: close < prev |
| InpPA_RequireHigherHigh | false | BUY: high > prev high | SELL: low < prev low |
| InpPA_LimitWickSize | true | Limit opposing wick size |
| InpPA_MaxOpposingWickPercent | 40.0 | Max opposing wick % of range (20.0,10.0,70.0) |
| InpPA_RequireStrongClose | true | Close in top/bottom third of bar |
| InpPA_StrongClosePercent | 70.0 | Min % threshold for strong close (60.0,50.0,90.0) |
| InpEnableMTFTrendFilter | false | Enable MTF trend alignment |
| InpMTFTrend_UseForInitialTrades | true | Use for initial trade entries |
| InpMTFTrend_UseForAdditionalTrades | false | Use for additional trades |
| InpMTFTrend_Timeframe1 | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trend timeframe 1 (intermediate) |
| InpMTFTrend_Timeframe2 | 9 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trend timeframe 2 (higher) |
| InpMTFTrend_Timeframe3 | 10 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Trend timeframe 3 (daily) |
| InpMTFTrend_MA1Period | 20 | TF1 MA period (10,1,200) |
| InpMTFTrend_MA2Period | 50 | TF2 MA period (10,1,200) |
| InpMTFTrend_MA3Period | 100 | TF3 MA period (10,1,200) |
| InpMTFTrend_MAMethod | MODE_EMA | MA calculation method |
| InpMTFTrend_MAPrice | 1 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MA applied price |
| InpMTFTrend_MinAligned | 2 | Min timeframes aligned (1,1,3) |
| InpMTFTrend_RequirePriceAbove | true | Price must be above/below all MAs |
| InpMTFTrend_RequireSlope | false | Require MA slope in direction |
| InpMTFTrend_SlopeLookback | 3 | Bars for slope calculation (2,1,10) |
| InpEnableAdxTrendFilter | false | Enable ADX trend filter |
| InpAdxTrend_UseForInitialTrades | true | Use for initial trade entries |
| InpAdxTrend_UseForAdditionalTrades | false | Use for additional trades |
| InpAdxTrend_Timeframe | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // ADX timeframe |
| InpAdxTrend_Period | 14 | ADX period (7,1,50) |
| InpAdxTrend_MinStrength | 25.0 | Min ADX value for trend (15.0,5.0,50.0) |
| InpAdxTrend_RequireDIAlignment | true | Require DI+/DI- directional confirmation |
| InpAdxTrend_MinDISeparation | 5.0 | Min DI+/DI- separation (0.0,1.0,20.0) |
| InpAdxTrend_RequireRising | false | Require ADX to be rising (strengthening trend) |
| InpAdxTrend_RisingBars | 2 | Bars to confirm ADX rise (1,1,5) |
| InpEnableSupertrendFilter | false | Enable Supertrend filter |
| InpSupertrend_UseForInitialTrades | true | Use for initial trade entries |
| InpSupertrend_UseForAdditionalTrades | false | Use for additional trades |
| InpSupertrend_Timeframe | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Supertrend timeframe |
| InpSupertrend_Period | 10 | ATR period (7,1,50) |
| InpSupertrend_Multiplier | 3.0 | ATR multiplier (1.0,0.5,10.0) |
| InpSupertrend_RequireConsecutiveBars | false | Require X bars in same trend state |
| InpSupertrend_ConsecutiveCount | 2 | Consecutive bars required (1,1,5) |
| InpEnableIchimokuFilter | false | Enable Ichimoku filter |
| InpIchimoku_UseForInitialTrades | true | Use for initial trade entries |
| InpIchimoku_UseForAdditionalTrades | false | Use for additional trades |
| InpIchimoku_Timeframe | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Ichimoku timeframe |
| InpIchimoku_TenkanPeriod | 9 | Tenkan-sen period (5,1,20) |
| InpIchimoku_KijunPeriod | 26 | Kijun-sen period (10,1,50) |
| InpIchimoku_SenkouPeriodB | 52 | Senkou Span B period (20,1,100) |
| InpIchimoku_RequireAboveCloud | true | BUY: price above cloud, SELL: below |
| InpIchimoku_RequireTKCross | false | Require Tenkan/Kijun crossover |
| InpIchimoku_CrossLookback | 5 | Max bars since TK cross (1,1,20) |
| InpIchimoku_RequireChikouClear | true | Chikou must be clear (not in price) |
| InpEnableVwapFilter | false | Enable VWAP filter |
| InpVwap_UseForInitialTrades | true | Use for initial trade entries |
| InpVwap_UseForAdditionalTrades | false | Use for additional trades |
| InpVwap_Timeframe | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // VWAP timeframe |
| InpVwap_Period | 20 | VWAP period (10,1,100) |
| InpVwap_RequirePriceAbove | true | BUY: price > VWAP, SELL: price < VWAP |
| InpVwap_RequireSlope | true | VWAP must slope in trade direction |
| InpVwap_SlopeLookback | 3 | Bars for slope calculation (2,1,10) |
| InpVwap_RequireMinDistance | false | Require min distance from VWAP |
| InpVwap_MinDistancePoints | 5.0 | Min distance in points (1.0,1.0,100.0) |
| InpEnableCorrelationMonitor | true | Enable correlation monitoring |
| InpCorrelationBlockEntries | true | Block new entries on correlation breakdown |
| InpCorrelationClosePositions | false | Close positions when correlation breaks down |
| InpCorrelationTimeframe | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Correlation timeframe |
| InpCorrelationLookback | 35 | Bars to evaluate correlation (10,1,500) |
| InpCorrelationMinThreshold | 3.975 | Minimum absolute correlation allowed (0.1,0.01,0.99) |
| InpCorrelationDivergenceTrigger | 0.25 | Minimum change to flag breakdown (0.05,0.01,1.0) |
| InpCorrelationConfirmBars | 1 | Consecutive bars required to confirm breakdown (1,1,10) |
| InpCorrelationSymbolSuffix | "m" | Broker symbol suffix (auto-appended) |
| InpCorrWatch_EURUSD | false | Monitor EURUSD correlation |
| InpCorrWatch_GBPUSD | false | Monitor GBPUSD correlation |
| InpCorrWatch_AUDUSD | false | Monitor AUDUSD correlation |
| InpCorrWatch_NZDUSD | false | Monitor NZDUSD correlation |
| InpCorrWatch_USDJPY | true | Monitor USDJPY correlation |
| InpCorrWatch_USDCAD | false | Monitor USDCAD correlation |
| InpCorrWatch_USDCHF | true | Monitor USDCHF correlation |
| InpCorrWatch_XAUUSD | false | Monitor XAUUSD correlation |
| InpEnableBarRangeFilter | false | Require minimum average bar range |
| InpBarRangeLookback | 5 | Number of bars to average (2,1,50) |
| InpMinBarRangePoints | 50.0 | Minimum average range (points) (1.0,1.0,1000.0) |
| InpEnableNFPFilter | true | Block trading on first Friday (NFP) |
| InpNFPStartHour | 8 | NFP release hour (broker time) (0,1,23) |
| InpNFPStartMinute | 30 | NFP release minute (0,1,59) |
| InpNFPAvoidMinutesBefore | 30 | Stop trading X min before NFP (5,1,120) |
| InpNFPAvoidMinutesAfter | 30 | Resume trading X min after NFP (5,1,120) |
| InpNFPClosePositions | false | Close positions before NFP |
| InpNFPCloseMinutesBefore | 10 | Close X min before NFP (1,1,60) |
| InpNFPCloseProfitOnly | true | Only close profitable positions |
| InpEnableEventPauseFilter | false | Enable CSV-driven event blackout |
| InpEventPauseCsvFile | "USDJPY.csv" | CSV filename located in MQL5\Files |
| InpEventPauseReloadMinutes | 60 | Reload CSV every N minutes (0=load once) |
| InpEventPauseLeadMinutes | 15 | Start blocking N minutes before pause window |
| InpEventPauseLagMinutes | 15 | Continue blocking N minutes after pause window |
| InpEventPauseDefaultYear | 0 | Override year if CSV omits it (0=auto) |
| InpEventPauseSymbolKey | "USDJPY" | Symbol keyword to match events |
| InpEnableAtrFilter | true | Require minimum ATR |
| InpAtrTimeframe | 6 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) |
| InpAtrPeriod | 60 | ATR period (5,1,50) |
| InpAtrAveragePeriod | 185 | ATR average period (10,1,200) |
| InpAtrMultiplierMin | 0.69 | ATR must be >= average*multiplier (0.5,0.1,5.0) |
| InpEnableSpreadFilter | true | Block trades during wide spreads |
| InpMaxSpreadPoints | 20.0 | Maximum allowed spread (points) (1.0,1.0,200.0) |
| InpEnableVolumeFilter | true | Enable volume filter for entries |
| InpVolumeType | VOLUME_TICK | Volume type to analyze |
| InpVolumeTimeframe | 7 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Volume data timeframe |
| InpVolumeThreshold | 0 | Minimum volume threshold (0=disabled) |
| InpUseVolumeAverage | true | Compare to average volume |
| InpVolumeAvgPeriod | 10 | Volume average period (5,1,100) |
| InpVolumeMultiplier | 0.65 | Volume must be >= average*multiplier (0.1,0.1,5.0) |
| InpEnableSessionFilters | true | Enable session-based trading |
| InpUseServerTime | true | Use broker server time (vs local) |
| InpTesterIgnoreMarketClosures | true | Ignore market closure guards while running in Strategy Tester |
| InpAsianSessionEnabled | true | Enable trading during Asian session |
| InpAsianSessionStartHour | 4 | Asian session start hour (0,1,23) |
| InpAsianSessionStartMinute | 20 | Asian session start minute (0,1,59) |
| InpAsianSessionEndHour | 19 | Asian session end hour (0,1,23) |
| InpAsianSessionEndMinute | 40 | Asian session end minute (0,1,59) |
| InpEuropeanSessionEnabled | true | Enable trading during European session |
| InpEuropeanSessionStartHour | 4 | European session start hour (0,1,23) |
| InpEuropeanSessionStartMinute | 0 | European session start minute (0,1,59) |
| InpEuropeanSessionEndHour | 17 | European session end hour (0,1,23) |
| InpEuropeanSessionEndMinute | 0 | European session end minute (0,1,59) |
| InpUSSessionEnabled | true | Enable trading during US session |
| InpUSSessionStartHour | 0 | US session start hour (0,1,23) |
| InpUSSessionStartMinute | 0 | US session start minute (0,1,59) |
| InpUSSessionEndHour | 10 | US session end hour (0,1,23) |
| InpUSSessionEndMinute | 0 | US session end minute (0,1,59) |
| InpCustomSessionEnabled | false | Enable trading during custom session |
| InpCustomSessionStartHour | 22 | Custom session start hour (0,1,23) |
| InpCustomSessionStartMinute | 0 | Custom session start minute (0,1,59) |
| InpCustomSessionEndHour | 23 | Custom session end hour (0,1,23) |
| InpCustomSessionEndMinute | 59 | Custom session end minute (0,1,59) |
| InpEnableEndOfDayClose | false | Close all trades at specific time |
| InpEndOfDayCloseHour | 23 | Close hour (0,1,23) |
| InpEndOfDayCloseMinute | 45 | Close minute (0,1,59) |
| InpEndOfDayProfitOnly | false | Only close profitable positions |
| InpEndOfDayBlockNewTrades | true | Block new trades after close time |
| InpEnableChoppinessFilter | true | Enable choppiness detection and filtering |
| InpChopRequireLayers | 1 | Layers required to confirm choppiness (1,1,4) |
| InpChopUseChopIndex | false | Enable Choppiness Index layer |
| InpChopIndexTimeframe | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // CHOP indicator timeframe |
| InpChopIndexPeriod | 134 | CHOP calculation period (10,1,50) |
| InpChopIndexThreshold | 52.5 | Choppy when CHOP > threshold (50.0,1.0,80.0) |
| InpChopUseAdx | false | Enable ADX trend strength layer |
| InpChopAdxTimeframe | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // ADX timeframe |
| InpChopAdxPeriod | 45 | ADX period (7,1,50) |
| InpChopAdxMinTrend | 82.5 | Choppy when ADX < threshold (15.0,1.0,40.0) |
| InpChopUseRangeCompression | true | Enable range compression detection |
| InpChopRangeTimeframe | 7 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Range compression timeframe |
| InpChopRangeLookback | 18 | Bars to compare range compression (3,1,20) |
| InpChopRangeAtrPeriod | 28 | ATR period for range comparison (10,1,50) |
| InpChopRangeCompressionRatio | 0.75 | Choppy when range < ATR*ratio (0.2,0.1,1.0) |
| InpChopUseAdaptiveThresholds | false | Dynamically adjust thresholds based on volatility |
| InpChopAdaptiveAtrPeriod | 50 | ATR period for adaptive scaling (20,1,100) |
| InpChopAdaptiveMultiplier | 1.5 | Volatility 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 |
| InpEnableProfitScaling | false | Enable partial profit taking |
| InpScalingLevels | 3 | Number of scaling levels (1,1,5) |
| InpScalingTargets | "50,100,200" | Profit targets (points), comma-separated |
| InpScalingPercents | "30,30,40" | % to close at each level |
| InpEnableMaxHoldingTime | false | Enable position time limits |
| InpMaxHoldingHours | 14 | Maximum holding time (hours) (1,1,240) |
| InpCloseProfitableOnly | true | Close only profitable positions |
| InpMinProfitThreshold | 0.0 | Profit threshold (points) (0.0,1.0,500.0) |
| InpEnableMomentumExit | false | Exit on momentum loss |
| InpMomTimeframe | 7 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) |
| InpMomRsiPeriod | 124 | RSI period for momentum exit (5,1,30) |
| InpMomRsiOverbought | 70.0 | RSI exit for buys (60.0,1.0,100.0) |
| InpMomRsiOversold | 40.0 | RSI exit for sells (0.0,1.0,40.0) |
| InpMomAdxPeriod | 14 | ADX period for exit (7,1,30) |
| InpMomAdxWeakThreshold | 0.0 | Exit when ADX drops below (5.0,1.0,40.0) |
| InpEnableVolatilityExit | false | Exit on ATR spike |
| InpVolExitAtrTimeframe | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) |
| InpVolExitAtrPeriod | 79 | ATR period (5,1,50) |
| InpVolExitAtrAvgPeriod | 25 | ATR average period (10,1,200) |
| InpVolSpikeMultiplier | 1.8 | ATR spike threshold vs avg (1.0,0.1,10.0) |
| InpVolExitProfitOnly | true | Require profit before ATR spike exit |
| InpEnableSRExit | false | Exit at key levels |
| InpSRLookbackBars | 50 | Bars to find swing points (5,1,500) |
| InpSRDistancePoints | 20.0 | Distance to trigger exit (1.0,1.0,1000.0) |
| InpSRExitProfitOnly | false | Only if profitable |
| InpEnableCCIExit | true | Enable CCI exhaustion exit |
| InpCCITimeframe | 5 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // CCI timeframe |
| InpCCIPeriod | 28 | CCI period (10,1,50) |
| InpCCIPrice | 1 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // CCI applied price |
| InpCCIOverbought | 345.0 | Overbought level (100.0,10.0,300.0) |
| InpCCIOversold | -585.0 | Oversold level (-300.0,10.0,-100.0) |
| InpCCIUseDivergence | true | Detect divergence |
| InpCCIDivergenceBars | 32 | Divergence lookback bars (3,1,20) |
| InpCCICloseProfit | true | Close profitable positions |
| InpCCICloseLoss | false | Close losing positions too |
| InpCCIMinProfitPoints | 51.0 | Min profit to close (0.0,1.0,100.0) |
| InpEnableMACDSlopeExit | false | Enable MACD slope exit |
| InpMACDTimeframe | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // MACD timeframe |
| InpMACDFastEMA | 12 | Fast EMA (5,1,50) |
| InpMACDSlowEMA | 26 | Slow EMA (10,1,100) |
| InpMACDSignal | 9 | Signal line (5,1,20) |
| g_InpMacdPrice | 1 | Applied price (1=close,2=open,3=high,4=low,5=median,6=typical,7=weighted) // MACD applied price |
| InpMACDWatchHistogram | true | Monitor histogram slope |
| InpMACDSlopeBars | 2 | Bars for slope calculation (1,1,5) |
| InpMACDWaitZeroCross | false | Wait for zero line cross |
| InpMACDCloseProfit | true | Close profitable positions |
| InpMACDCloseLoss | false | Close losing positions too |
| InpMACDMinProfitPoints | 5.0 | Min profit to close (0.0,1.0,100.0) |
| InpMACDMinSlopeThreshold | 0.0001 | Min histogram change (0.0,0.00001,0.001) |
| InpEnableSwingExit | false | Enable swing reversal exit |
| InpSwingLeftBars | 3 | Left bars for swing (2,1,10) |
| InpSwingRightBars | 2 | Right bars for swing (1,1,10) |
| InpSwingMinSize | 20.0 | Min swing size points (5.0,1.0,100.0) |
| InpSwingPartialClose | true | Close half positions first |
| InpSwingCloseProfit | true | Close profitable positions |
| InpSwingCloseLoss | false | Close losing positions too |
| InpSwingMinProfitPoints | 15.0 | Min profit to close (0.0,1.0,100.0) |
| InpSwingMaxAge | 3 | Max bars ago for swing (1,1,10) |
| InpEnableStochExit | true | Enable stochastic exit |
| InpStochTimeframe | 5 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Stochastic timeframe |
| InpStochKPeriod | 47 | %K period (5,1,50) |
| InpStochDPeriod | 27 | %D period (2,1,20) |
| InpStochSlowing | 23 | Slowing (1,1,10) |
| InpStochOverbought | 512.0 | Overbought (70.0,5.0,100.0) |
| InpStochOversold | 110.0 | Oversold (0.0,5.0,30.0) |
| InpStochWaitCross | true | Wait for %K/%D crossover |
| InpStochCloseProfit | false | Close profitable positions |
| InpStochCloseLoss | true | Close losing positions too |
| InpStochMinProfitPoints | 26.0 | Min profit to close (0.0,1.0,100.0) |
| InpEnableROCExit | false | Enable ROC momentum exit |
| InpROCTimeframe | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // ROC timeframe |
| InpROCPeriod | 12 | ROC lookback period (5,1,50) |
| InpROCThreshold | 0.5 | Min ROC to stay in (0.0,0.1,5.0) |
| InpROCWeakBars | 2 | Consecutive weak bars (1,1,5) |
| InpROCCloseNewest | false | Close newest positions first |
| InpROCCloseProfit | true | Close profitable positions |
| InpROCCloseLoss | false | Close losing positions too |
| InpROCMinProfitPoints | 0.0 | Min profit to close (0.0,1.0,100.0) |
| InpEnableMTFExit | false | Enable MTF trend exit |
| InpMTFTimeframe | 8 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // Higher timeframe to monitor |
| InpMTFMAPeriod | 50 | MA period for trend (20,1,200) |
| InpMTFMAMethod | MODE_EMA | MA method |
| InpMTFCloseOnCross | true | Close when price crosses MA |
| InpMTFPartialExit | true | Close oldest 50% first |
| InpMTFCloseProfit | true | Close profitable positions |
| InpMTFCloseLoss | false | Close losing positions too |
| InpMTFMinProfitPoints | 20.0 | Min profit to close (0.0,1.0,100.0) |
| InpEnableSARExit | false | Enable SAR flip exit |
| InpSARTimeframe | 0 | Timeframe (1=M1,2=M5,3=M15,4=M30,5=H1,6=H4,7=D1) // SAR timeframe |
| InpSARStep | 0.02 | SAR step (0.01,0.001,0.1) |
| InpSARMaximum | 0.2 | SAR maximum (0.1,0.01,0.5) |
| InpSARCloseAll | true | Close all positions on flip |
| InpSARCloseProfit | true | Close profitable positions |
| InpSARCloseLoss | false | Close losing positions too |
| InpSARMinProfitPoints | 0.0 | Min 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 |
| InpShowDashboard | false | Display on-chart dashboard |
| InpDashboardX | 8 | Dashboard X position (pixels) |
| InpDashboardY | 28 | Dashboard Y position (pixels) |
| InpDashboardWidth | 360 | Dashboard width (pixels) |
| InpDashboardBgColor | (color)525572 | Dashboard background color |
| InpDashboardBgOpacity | 245 | Dashboard fill opacity (0 transparent, 255 solid) (0,1,255) |
| InpDashboardTextColor | (color)16777215 | Dashboard text color |
| InpDashboardAccentColor | (color)16748574 | Dashboard header/accent color |
| InpAttachHullIndicators | false | Show Hull indicator overlays on chart |
| InpHullIndicatorSubwindow | 1 | Subwindow index for Hull overlays (0=main chart, 1+=subwindows) |
| InpShowRsiIndicator | false | Display RSI indicator visualization |
| InpRsiIndicatorSubwindow | 2 | Subwindow index for RSI visualization (1+=subwindows) |
| InpShowAdxIndicator | false | Display ADX indicator visualization |
| InpAdxIndicatorSubwindow | 3 | Subwindow index for ADX visualization (1+=subwindows) |
| InpShowAtrIndicator | false | Display ATR indicator visualization |
| InpAtrIndicatorSubwindow | 4 | Subwindow index for ATR visualization (1+=subwindows) |
#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.
Clear Warning: Educational Purposes Only
Clear Warning: This Expert Advisor is for educational and testing purposes only. Do NOT use it with real money. Test only on demo accounts. Trading with real money involves substantial risk of capital loss. This does not constitute investment advice.
Recommended Brokers for This EA
These EAs run on MT5 — use a regulated broker with fast execution and tight spreads
Markets.com
Exness
IC Markets
Similar Expert Advisors
View All Expert AdvisorsMore Trend Following strategy EAs from our library
Pipsgrowth EX16080 Trend
Pipsgrowth.com EX16080 EURUSDTrendFollower — triple-EMA H4 trend follower, full 12-layer stack.
Pipsgrowth EX16081 Trend
Pipsgrowth.com EX16081 GoldTrendEA — XAUUSD H4 EMA cross with Fib targets, full 12-layer stack.
Pipsgrowth EX16033 Trend
Pipsgrowth.com EX16033 EA_Price_Action — price-action grid scalper, full 12-layer stack.
Community
Educational purposes only. Do NOT use with real money. Test on demo accounts only.