Gold Alhamdulillah Hedging
- Experts
- Version: 1.0
- Activations: 10
Alhamdulillah Hedging is a multi-symbol trading system designed for MetaTrader 5 netting and hedging accounts. It combines dynamic grid calculations, statistical market state detection, and account protection systems to manage trade positions across multiple symbols from a single chart.
System Advantages
- Multi-Symbol Execution: Control trade entries and management across a list of custom symbols simultaneously from one active chart.
- Statistical Market Regime Detection: Classifies market conditions into trending, ranging, or volatile states using autocorrelation and volatility calculations, adjusting the trading grid accordingly.
- Dynamic Spacing: Spreads grid levels using Average True Range (ATR) calculations to automatically widen grids during volatile market conditions.
- Smart Drawdown Recovery: Activates recovery trade logic at specified grid depths to close basket levels at minimal profit zones, helping to resolve open drawdowns.
- Stealth Management: Includes an option to manage Stop Loss and Take Profit levels internally, keeping targets hidden from the broker.
- News Filter Integration: Automatically pauses trade entries before and after high-impact macroeconomic events using the built-in calendar or local files.
- Ultimate Account Protector: Features a suite of safety options, including daily drawdown limits, daily profit targets, margin level triggers, and time-based exits.
Input Parameters
General Settings
- EAName (Default: "Alhamdulillah Hedging"): Custom name used for trade identifiers and order comments.
- InpTradeSymbols (Default: ""): Comma-separated list of symbols to trade (e.g., EURUSD,GBPUSD). If left empty, the EA trades only the chart symbol.
- InpLiveMode (Default: false): When enabled, forces strict broker stop-level and freeze-level checks during testing.
- InpUseDynamicGrid (Default: false): Enables dynamic ATR-based spacing for grid levels instead of fixed distances.
- InpAvoidHighImpactNews (Default: false): Enables the news filter to restrict trading before and after high-impact events.
- InpNewsMinutesBefore (Default: 30): Minutes to pause trade entries before high-impact news.
- InpNewsMinutesAfter (Default: 30): Minutes to pause trade entries after high-impact news.
- InpUseTrailingStop (Default: false): Enables trailing stop-loss management for open positions.
- InpTrailingStopPips (Default: 20.0): Trailing stop distance in pips.
- InpTrailingActivationPips (Default: 10.0): Minimum profit in pips required to activate the trailing stop.
- InpMaxTrailHoldHours (Default: 0.0): Maximum hours to trail a position before locking the stop-loss (0 turns this feature off).
- InpStrategy (Default: Grid Martingale): Core trading strategy logic (options: Grid Martingale, Drawdown Lock).
- InpLotSizing (Default: Fixed): Sizing calculation method (options: Fixed Lot, Percent of Equity, ATR Volatility).
Market Regime Filter Settings
- InpUseRegimeFilter (Default: true): Enables filtering trade entries based on calculated trend and volatility states.
- InpRegimeTimeframe (Default: Current): Timeframe used for the primary market regime classification.
- InpRegimeTimeframe2 (Default: Current): Timeframe used for secondary regime confluence checks.
- InpRegimeLookback (Default: 100): Number of bars used in volatility and autocorrelation calculations.
- InpAutocorrThreshold (Default: 0.2): Sensitivity threshold for trend detection using autocorrelation logic.
- InpVolThresholdPercent (Default: 0.5): Volatility threshold to classify ranging versus volatile states.
Grid and Recovery Settings
- InpUseRecovery (Default: true): Enables the drawdown recovery module.
- InpRecoveryStartLevel (Default: 6): The grid depth at which the recovery phase begins.
- InpRecoveryProfit (Default: 1.0): Target profit to close the recovery trades.
- InpUseAdaptiveRisk (Default: true): Automatically reduces initial lot sizes as account drawdown increases.
- InpBaseLots (Default: 0.01): Starting lot size for fixed volume operations.
- InpRiskPercent (Default: 1.0): Risk percentage per trade when using equity-based sizing.
- InpPips (Default: 100): Fixed distance in points between grid levels if dynamic grid is disabled.
- InpFixedSpread (Default: 3): Fixed spread value in points used for safety margin calculations.
- InpNbLevels (Default: 10): Maximum allowed grid levels per symbol.
- InpMaxDailyDrawdown (Default: 10.0): Daily loss limit percentage that triggers a temporary trading halt.
- InpDailyProfitTarget (Default: 5.0): Daily profit target percentage to secure profits and halt trading.
- InpStealthMode (Default: false): Hides stop-loss and take-profit targets from the broker server.
- InpContinueTrading (Default: true): Resumes grid sequences after a cycle closes.
- MagicNumber (Default: 123321): Unique numerical identifier for orders placed by this EA.
Ultimate Account Protector Settings
- Prot_EquityGrowthPct (Default: 0.0): Equity increase percentage target to trigger closure of all trades (0 disables).
- Prot_MinFreeMargin (Default: 0.0): Minimum free margin threshold. If breached, the EA sends an alert and halts new entries.
- Prot_MinMarginLevel (Default: 0.0): Margin level percentage threshold below which automated trading is disabled.
- Prot_SpreadCloseMax (Default: 0.0): Closes open positions if spreads widen beyond this limit in points.
- Prot_ExitTerminalTime (Default: ""): Scheduled time (HH:MM) to close trades and halt trading.
- Prot_ExitTerminalDay (Default: Friday): Scheduled day of the week to execute time-based exits.
- InpUserGMT (Default: 0): Local GMT offset matching your input times.
- Prot_EnableTradingTime (Default: ""): Restricts trade entries to a specific daily window (HH:MM to HH:MM).
- Prot_PriceLevelClose (Default: 0.0): Price level trigger. Closes all trades if price trades past this level for 10 seconds.
- Prot_MaxOpenPositions (Default: 0): Closes sell trades if total open positions exceed this limit.
- Prot_MaxOrdersCompound (Default: 0): Limits total combined pending and active orders.
- Prot_CompoundBalance (Default: 0.0): Account balance limit paired with compound order protection.
- Prot_LossReduction (Default: 0.0): Closes losing trades if absolute floating loss exceeds this dollar value.
- Prot_PartialCloseLevels (Default: ""): Comma-separated list of profit points for scale-out targets (e.g., 30,50,70).
- Prot_TrailCommentTrades (Default: false): Activates trailing stops only on trades with specific comments.
- Prot_MagicTerminalExit (Default: 0): Magic number monitored for terminal shutdown triggers.
- Prot_MagicProfitPts (Default: 0.0): Profit point target for monitored Magic Number to trigger exits.
- Prot_CrossSymTrigger (Default: ""): Symbol monitored to trigger actions on other instruments.
- Prot_CrossSymCount (Default: 0): Number of trades required on the trigger symbol to execute cross-symbol commands.
- Prot_CrossSymTarget (Default: ""): Target symbol whose pending orders will be deleted upon trigger.
- Prot_SymPendingTarget (Default: 0.0): Monetary profit target used to clear pending orders on a symbol.
- Prot_SymPendingSymbol (Default: ""): Symbol monitored for profit targets to clear pending orders.
- Prot_DevEquitySnapshot (Default: 0.0): Equity deviation limit to close correlated charts (0 disables).
- Prot_IsMasterInstance (Default: false): Identifies this chart instance as the master monitor for equity snapshots.
