XAU QuantSweep MT5
- Uzmanlar
- Sürüm: 9.22
- Etkinleştirmeler: 5
XAU QuantSweep MT5
Liquidity Sweep and Structural Reclaim Scalping Engine for Gold
XAU QuantSweep is a hybrid quantitative Expert Advisor designed specifically for XAUUSD / GOLD.
The architecture combines multi-timeframe structural analysis, liquidity sweep detection, live tick-based microstructure confirmation, intermarket correlation analysis, execution-condition filtering, automated news protection, and structured trade lifecycle management.
CORE CONCEPT
XAU QuantSweep is built around a simple principle:
Do not treat every price movement as a trading opportunity.
The engine first evaluates market structure, liquidity conditions, execution quality, and confirmation strength before allowing a trade.
The system is designed to identify structural liquidity sweeps and reclaim events, then validate them through lower-timeframe price behavior and live tick information.
This allows the EA to distinguish between a potentially meaningful structural event and ordinary market noise.
HOW THE ENGINE WORKS
1. Multi-Timeframe Structural Mapping
The CHTFZoneEngine analyzes higher-timeframe structure using H4, H1, and M15 data.
It maps structural zones from swing extremes and displacement-origin areas, then uses these zones as higher-timeframe context for the tactical trading engine.
2. Tactical Liquidity Detection
The CStructureEngine operates around the tactical M5 structure.
It monitors local swing levels, liquidity sweeps, structural breaks, and break-and-retest behavior.
3. Liquidity Sweep and Structural Reclaim
When a structural sweep is detected, the EA evaluates the subsequent reclaim behavior before an entry can be considered.
The CZoneLogicEngine and CSnapbackEngine evaluate the reclaim using real-time market information, including:
-
Tick velocity
-
Price acceleration
-
Price rejection behavior
-
Micro impulse characteristics
-
Tick-volume imbalance
-
Quote velocity
-
Retest confirmation
4. Intermarket Causality Analysis
Gold does not trade in isolation.
The CCausalityEngine evaluates the available relationship between XAUUSD and external market references such as the US Dollar Index (DXY) and a 10-Year US Treasury Yield proxy (US10Y).
When the available intermarket information conflicts with the structural trading thesis, the entry decision can be rejected rather than forced.
EXECUTION AND MARKET-CONDITION PROTECTION
Execution Quality Monitoring
The execution layer continuously evaluates trading conditions such as:
-
Current spread
-
Execution slippage
-
Freeze conditions
-
Order rejection conditions
-
Execution quality
-
Estimated trading viability after costs
When the execution environment becomes unsuitable, the system can block a trade or reduce exposure according to the configured risk and execution rules.
Spread Protection
The EA includes a configurable maximum spread threshold.
When the current spread exceeds the configured limit, the entry can be rejected instead of being executed under unfavorable trading conditions.
Execution Survivability
The architecture is designed to account for real execution conditions rather than assuming that every broker provides identical spread, latency, and fill behavior.
TRADE GOVERNANCE
Anti-Flapping Protection
The CAntiFlappingEngine contains multiple protection layers that help control rapid direction changes, repeated entries, and unstable trade behavior during choppy market conditions.
The system includes protection mechanisms related to signal persistence, exit cooldowns, direction locks, and re-entry control.
Trade State Machine
The trade lifecycle is governed through a structured state-machine architecture.
A position can progress through different management states as market conditions develop, instead of being handled as a static order from entry to exit.
Thesis Health Monitoring
The CHypothesisEngine tracks the logical health of the trade thesis, including expected behavior, invalidation conditions, and changing market evidence during the position lifecycle.
RISK AND POSITION MANAGEMENT
XAU QuantSweep is designed around controlled position exposure rather than recovery grids or progressive loss-recovery logic.
-
Independent Stop Loss protection
-
Configurable position limits
-
Optional dynamic lot sizing
-
Maximum lot-size control
-
Break-even management
-
Trailing-stop management
-
Partial-close management
-
Maximum holding-time control
-
Structural invalidation monitoring
The default configuration limits concurrent exposure to a single position.
Dynamic volume calculation can be enabled using the configured risk percentage and Stop Loss distance.
EXIT MANAGEMENT
The exit engine combines fixed protection with state-aware management.
Depending on the configuration and the evolution of the trade, the system can use:
-
Hard Stop Loss
-
Take Profit
-
Break-even
-
Trailing Stop
-
Partial Close
-
Opposite-signal confirmation
-
Structural invalidation
-
Exhaustion detection
-
Reversal confirmation
-
Maximum holding time
Exit Forensics
The system can evaluate post-entry behavior using persistence and confirmation requirements before advanced early-exit conditions are allowed to interfere with the original trade thesis.
NEWS FILTER
The EA includes an automated economic-calendar filter based on the MetaTrader 5 economic calendar functions.
The news protection layer can be configured to react to:
-
High-impact USD events
-
Medium-impact USD events
-
Non-Farm Payrolls (NFP)
-
Federal Reserve rate decisions / FOMC events
-
Interest-rate announcements
Configurable lockout windows can prevent new entries around selected economic events in order to reduce exposure to extreme event-driven market conditions.
TRADE AUDIT AND POST-TRADE LOG
XAU QuantSweep includes an automated trade-audit layer designed to preserve post-trade information for later analysis.
The CSelfAuditEngine and CPostTradeAutopsy components can record information such as:
-
Maximum Favorable Excursion (MFE)
-
Maximum Adverse Excursion (MAE)
-
Holding duration
-
Exit reason
-
Early-exit information
-
Trade-behavior statistics
The resulting information can be written to the local common CSV file:
GoldSweep_Autopsy_XAUUSD.csv
This provides an additional layer of transparency for post-trade analysis and strategy diagnostics.
INPUT PARAMETER OVERVIEW
CORE TRADING
InpMagicNumber — Unique identifier for EA positions.
InpLotSize — Default static lot size.
InpMaxPositions — Maximum simultaneous positions.
InpMaxRiskPct — Maximum configured account-risk percentage.
InpUseDynamicLots — Enables dynamic volume calculation.
InpMaxLotSize — Maximum allowed trading volume.
InpMinLotSize — Minimum allowed trading volume.
STRUCTURE DETECTION
InpLookbackBars — Historical M5 range used for structural scanning.
InpMinTouchCount — Minimum structural retest count.
InpLevelProximityPts — Level proximity tolerance.
InpSweepThresholdPts — Minimum sweep distance.
InpReclaimThreshold — Reclaim confirmation ratio.
InpStructureTF — Tactical structure timeframe.
HIGH-TIMEFRAME ZONE VALIDATION
InpMajorZoneTF — Major directional context timeframe.
InpPrimaryZoneTF — Primary structural timeframe.
InpConfirmZoneTF — Confirmation context timeframe.
InpHTFZoneLookbackBars — Higher-timeframe zone lookback.
InpHTFZoneProximityPts — Sweep-to-zone proximity tolerance.
InpHTFMinZoneScore — Minimum zone-quality threshold.
InpHTFMaxZoneTouches — Maximum zone retests before exhaustion.
ENTRY CONDITIONS
InpMinSessionQuality — Minimum session-quality threshold.
InpMaxBreakRetestAgeBars — Maximum age for retest candidates.
InpBreakRetestBufferPts — M1 retest tolerance.
InpMinRetestConfirmSeconds — Minimum retest confirmation duration.
InpMinPostRetestImpulsePts — Required post-retest impulse.
InpGoldNoiseFloorPts — Minimum gold market room.
InpMaxSpreadPts — Maximum permitted spread.
InpMinLiquidity — Minimum configured liquidity threshold.
EXIT CONDITIONS
InpTakeProfitPts — Take Profit distance.
InpStopLossPts — Stop Loss distance.
InpUseTrailingStop — Enables trailing-stop management.
InpUseBreakeven — Enables break-even management.
InpMinHoldSeconds — Minimum holding duration.
InpMaxHoldSeconds — Maximum position duration.
EXIT FORENSICS
InpMinMaturationSec — Validation period before advanced exits.
InpOppositeSignalMinQuality — Minimum opposite-signal quality.
InpOppositeSignalMinTicks — Required opposing tick persistence.
InpOppositeSignalMinSeconds — Required opposing-duration persistence.
InpStructuralBreakBuffer — Structural invalidation buffer.
InpEnableAutopsyLog — Enables MAE/MFE audit logging.
InpEnablePrematureDetector — Tracks post-exit continuation.
TRADE STATE MACHINE
InpValidationWindowSec — Initial validation window.
InpExpansionThresholdPts — Expansion-state threshold.
InpMaturityThresholdPts — Maturity-state threshold.
InpExhaustionThreshold — Microstructure exhaustion threshold.
InpReversalThreshold — Reversal confirmation threshold.
InpReversalConfirmCount — Required reversal confirmations.
InpEnableThesisEngine — Enables trade-thesis monitoring.
InpThesisInvalidationBuffer — Thesis invalidation offset.
TRAILING AND POSITION MANAGEMENT
InpTrailingStopPts_V2 — Trailing-stop distance.
InpTrailingStepPts_V2 — Trailing modification step.
InpBreakevenPts_V2 — Break-even activation threshold.
InpPartialClosePts — Partial-close activation distance.
InpPartialClosePct — Percentage of volume used for partial close.
NEWS FILTER
InpEnableNewsFilter — Enables MetaTrader economic-calendar filtering.
InpNewsLockoutMin — High-impact event lockout period.
InpMediumImpactLockoutMin — Medium-impact event lockout period.
InpBlockNFPWindow — NFP event protection.
InpBlockFOMCWindow — FOMC protection.
InpBlockRateDecision — Rate-decision protection.
RECOMMENDED TRADING CONDITIONS
Symbol: XAUUSD / GOLD
Timeframe: M1
Structural Analysis: M5 + H4 + H1 + M15
Account Type: Hedging
Minimum Balance: $1,000 USD for the 0.01 lot configuration stated in this description
Broker Environment: Raw Spread / ECN with competitive execution conditions
VPS: A low-latency connection to the broker server is recommended
WHAT IS INCLUDED
-
Liquidity Sweep and Structural Reclaim logic
-
Multi-timeframe structural filtering
-
Live tick-based microstructure confirmation
-
Intermarket XAUUSD / DXY / US10Y analysis
-
Spread and execution-condition protection
-
Automated economic-news filtering
-
Structured trade state management
-
Break-even, trailing, and partial-close controls
-
Post-trade MFE / MAE forensic logging
-
Configurable position and risk controls
IMPORTANT RISK NOTICE
XAU QuantSweep is an automated trading system for MetaTrader 5.
Trading financial markets involves substantial risk, and no trading system can guarantee profits or eliminate losses.
Past performance and backtest results are not guarantees of future performance.
Backtests are simulations and may differ from live trading because of spread, slippage, liquidity, latency, execution conditions, symbol specifications, and broker-specific behavior.
Before using the EA on a live account, verify the broker's symbol specifications, spread, execution conditions, margin requirements, and trading environment on a demo account.
Prop-firm rules vary between providers. Always verify the current rules of the specific firm and confirm that your configuration complies with those rules before live deployment.
SUMMARY
XAU QuantSweep MT5 is a gold-focused quantitative Expert Advisor built around structural liquidity analysis rather than a single conventional indicator signal.
The decision architecture combines higher-timeframe structural mapping, M5 liquidity analysis, M1 execution confirmation, tick-based microstructure, intermarket context, execution-condition monitoring, news filtering, and state-based position management.
The result is a structured trading framework designed to evaluate the market before execution, manage the position throughout its lifecycle, and preserve post-trade information for furt
