Devastation
- Uzmanlar
- Sürüm: 1.0
DEVASTATION is an automated Expert Advisor built specifically for XAUUSD (Gold) on MetaTrader 5. It combines a Hedge entry model with a Grid/Martingale recovery system, layered with several independent risk-management filters designed to keep drawdown and exposure under control.
The EA opens a simultaneous Buy and Sell position (Hedge) when no trade is open, then manages each side independently: adding Grid positions when price moves against an open position, closing the full basket once a profit target is reached, and using a Counter Order mechanism to help balance the basket during extended Grid sequences.
Key Features
- Hedge + Grid Martingale core strategy — opens Buy and Sell together, then scales into the market with configurable lot multiplier and grid step.
- Counter Order system — opens a counter-trend position once the Grid reaches a configurable threshold, to help offset drawdown during strong trends.
- Signal-based entries — Stochastic + EMA trend filter for additional entries once a Hedge cycle is active.
- Volatility filter — automatically pauses new entries during abnormal ATR spikes, oversized candles, or wide spread conditions.
- Two independent trading-hour sessions per day — restrict new entries to your preferred trading windows (Thailand time, UTC+7 based).
- Friday protection filter — no new cycles are opened on Friday; any open basket is allowed to reach its profit target before closing (no forced loss-close).
- Maximum Drawdown Protection — automatically closes all positions and stops the EA if drawdown exceeds your configured limit.
- Daily Profit Target — locks in daily gains and pauses new trading once the day's profit goal is reached.
- Profit close by fixed amount or % of balance — choose whichever suits your account size.
Requirements
- MetaTrader 5, Hedging-type account (required — the EA opens Buy and Sell on the same symbol simultaneously)
- Recommended symbol: XAUUSD
- A VPS is recommended for uninterrupted 24-hour operation
Input Parameters
- InpSignalLot — lot size for signal-based entries (Stochastic + EMA)
- InpMartMultiplier — lot multiplier applied to each new Grid position
- InpGridDistance — distance in points before the next Grid position opens
- InpTotalProfitClose — total profit (account currency) that triggers a full close of the current basket
- InpCounterLot — lot size for Counter Order positions
- InpUsePctClose / InpProfitPct — optional close by percentage of balance instead of a fixed amount
- InpCloseDeviation — maximum allowed slippage (points) when closing
- InpAlertOnClose — show an on-screen alert whenever the basket closes in profit
- InpNoFriday — disable opening new cycles on Fridays
- InpUseDDProtect / InpMaxDDPercent — maximum drawdown protection and its threshold
- InpUseDailyProfit / InpDailyProfitTarget / InpAlertDailyTarget — daily profit lock settings
- InpUseTimeFilter / InpStartHour / InpEndHour — trading session 1 (format HH.MM, e.g. 9.00 = 09:00, 9.30 = 09:30, Thailand time)
- InpUseTimeFilter2 / InpStartHour2 / InpEndHour2 — trading session 2 (same format, optional second window)
- InpMagic — unique identifier for this EA's orders, useful when running multiple EAs on the same account
Risk Warning
This EA uses a Hedge and Grid/Martingale strategy, which by nature increases position size when the market moves against an open trade. This approach can produce steady gains in ranging or moderately trending conditions, but carries a real risk of significant drawdown — and potential loss of the full account balance — during strong, sustained trending moves or extreme volatility. Past performance and backtest results do not guarantee future results. Always test on a demo account first, and only trade with capital you can afford to lose. Use appropriate lot sizing and the built-in risk controls (Max Drawdown Protection, Daily Profit Target) according to your own risk tolerance.
