HEXAGON EDGE — Expert Advisor for XAU/USD
Developed by: Worldinversor 2026 Recommended Pair: XAU/USD (Spot Gold) Timeframe: M5 Minimum Recommended Capital: USD 500 Recommended Broker: IC Markets
Overview
Hexagon Edge v3.0 is an institutional-grade Expert Advisor designed exclusively for trading the XAU/USD pair on the M5 timeframe. It combines artificial intelligence, quantitative statistical models, and structural market analysis in a multi-layered confluence system that evaluates each signal from different angles before executing a trade. Its dual-engine architecture (neural + statistical) positions it at the forefront of automated gold trading systems.
Artificial Intelligence Engine
The EA's core integrates two independent AI engines that operate in parallel:
BiLSTM Neural Network (Bidirectional Long Short-Term Memory): Analyzes the last 30 candlesticks in both timeframes simultaneously, processing 6 characteristics per bar (return, body structure, relative volatility, among others). The model evaluates the probability of an upward or downward movement with a configurable confidence threshold, triggering signals only when the certainty exceeds 60%.
Multinomial Logistic Regression with Adaptive Learning: A statistical engine with 3 classes (bullish, neutral, bearish) that extracts 8 features per bar (short- and long-term momentum, ATR volatility, candlestick structure, and recent range position). The model is automatically updated every 5 bars using a stochastic gradient descent, continuously adapting to market conditions.
Structural and Pattern Analysis
The system detects and trades on high-probability market structures:
Chart patterns: Head & Shoulders, Inverse Head & Shoulders, Double Top, and Double Bottom, with automatic neckline detection and target projection.
Support and Resistance Zones: A proprietary engine that identifies levels with at least two touches in the last 100 candlesticks, draws confluence zones, and trades confirmed bounces and breakouts.
Price Action: Detection of Harami, Tweezer Tops/Bottoms, and Marubozu candlesticks with tolerance filters and body size validation.
Advanced Quantitative Modules
HRP — Hierarchical Risk Parity: Portfolio management algorithm that dynamically weights each signal engine (BiLSTM, Logistic Regression, S&R) based on its historical correlation and variance, balancing the contribution to total risk according to institutional principles of hierarchical risk parity.
HJB — Hamilton-Jacobi-Bellman / Continuous Kelly Criterion: Optimal sizing engine based on stochastic control. It calculates the asset's drift and volatility in real time to derive the risk-aversion-adjusted Kelly Criterion, optimizing lot size in each trade without overexposure.
Fibonacci Extension Targets (127.2% / 141.4% / 161.8%): Automatically calculates relevant swings in the configured lookback and projects extension targets. These levels are integrated as priority take-profits when the price has an aligned structure.
HVP — Harmonic Volatility Pattern: Detects volatility compression (squeeze) by comparing the recent ATR with the historical average. When a post-squeeze expansion occurs that exceeds the minimum ratio, it generates a high-confidence signal with a configurable momentum boost.
Integrated Technical Indicators
Williams Alligator (13/8 — 8/5 — 5/3): Filters the market status as bullish, bearish, or dormant before validating any signal.
Volume Indicator with MA: Classifies the current volume as high or low relative to its average, adding a layer of institutional confirmation.
Volume Profile (20 bins, 100 candles): Calculates the Point of Control (POC), Value at Height (VAH), Value at Level (VAL), and classifies High Volume (HVN)/Low Volume (LVN) zones using statistical analysis of volume distribution by price.
Risk Management and Execution
The Expert Advisor (EA) features a multi-layered risk and equity management system:
Three sizing modes: Fixed lot, percentage of balance, or dynamic percentage of equity.
Stop Loss/Take Profit with a configurable minimum risk:reward ratio (default 1:3, Stop Loss 20 pips / Take Profit 60 pips).
Trailing Stop that can be triggered from 8 pips of profit with 4-pip increments.
Automatic Break-Even upon reaching the configurable trigger.
Maximum daily drawdown control (default 10% of the initial balance).
Limit on simultaneous positions (default 5) and total volume limit.
Spread control with automatic pause if it exceeds the maximum allowed.
Free margin filter that prevents trading below 50% of available margin.
Turbo Mode: Increases lot size by 1.5x and extends signal lookback for high-volatility markets.
Optional filters: Stochastic, Momentum, and Williams %R as additional confluence filters.
"Quantum Edge" Visual Panel
The EA includes a dual-column HUD panel that is always visible on the chart, displaying real-time information on: the status of each AI engine, the latest signal with confidence percentage, the Alligator status, volume, the Volume Profile POC, active Fibonacci extensions, open and daily P&L, win rate, open positions, equity/balance, and daily drawdown. The Dark Slate Navy visual scheme with electric blue and gold accents is optimized for long monitoring sessions.
Recommended Configuration
Parameter Value Pair XAU/USD Timeframe M5 Minimum Capital USD 500 Broker IC Markets (ECN/Raw Spread) Risk per Trade 1% of Balance Stop Loss 20 pips Take Profit 60 pips Risk Mode Fixed Percentage
Hexagon Edge v3.0 is designed for traders seeking quantitative automation on the most volatile and liquid asset in the commodities market. Its modular architecture allows each motor to be activated or deactivated independently, adapting the system to different market conditions.