Adaptive Martingale
- Experts
- Mr Theera Mekanand
- Versione: 1.3
Adaptive Martingale is a trend-following martingale grid Expert Advisor designed for XAUUSDc (Gold Cent Accounts). It combines Hull Moving Average (HMA) trend detection with volatility protection, tailored for gold's price characteristics. The EA includes risk management features relevant to precious metals trading and is designed for use on cent accounts.
The "Adaptive" name refers to the EA's approach of adjusting in real time to gold's volatility through Average True Range (ATR) based grid spacing and circuit breaker logic.
Gold Characteristics for Grid Trading
Gold (XAU/USD) has several characteristics relevant to grid trading strategies. It exhibits relatively high volatility, which can generate frequent grid-level triggers. Gold tends to display trending behavior across multiple timeframes and offers 24-hour liquidity across major trading sessions. Its ATR patterns tend to be relatively consistent across sessions, and cent account compatibility allows for smaller deposit sizes.
Features
1. Gold-Focused Trend Detection
The EA uses a Hull Moving Average on the M30 timeframe with a 150-period setting to detect directional moves. It switches between BUY and SELL modes based on the detected trend direction. Trend flip protection is included to reduce exposure when the trend reverses. The parameters are calibrated for gold's swing patterns and momentum characteristics.
2. Adaptive ATR-Based Grid Spacing
Grid distance adjusts automatically based on real-time volatility readings. The default calibration targets the XAUUSDc typical ATR range of 2.5 to 5.0. This approach reduces premature triggering during normal gold fluctuations by applying wider spacing during volatile sessions and tighter spacing during consolidation. The grid distance updates every M5 bar close for continuous adjustment.
3. Volatility Circuit Breaker
The EA monitors for abnormal price spikes that may occur during major economic releases such as Non-Farm Payrolls (NFP), Federal Open Market Committee (FOMC) announcements, and Consumer Price Index (CPI) reports. When a spike is detected, new entries are blocked for a configurable cooldown period. Detection runs on both closed-bar and live-bar data to reduce exposure during rapid price movements.
4. Trading Hours Configuration
Session windows are pre-configured for gold trading. The default window runs from 23:00 UTC to 22:00 UTC, covering nearly 24 hours on weekdays. A Friday cutoff at 22:00 UTC is included to reduce weekend gap exposure. Weekday filtering is available for session-specific approaches.
5. Risk Management for Cent Accounts
The EA includes a daily threshold that stops trading after reaching a configurable limit. A global weighted average take-profit system manages open positions collectively. Lot multiplication is configurable with a default of 2.0x. Optional hedge positions can be opened when the grid extends beyond a defined threshold. Additional safeguards include position count limits and emergency stops. A visual overlay displays the current status of these parameters on the chart.
6. Visual Interface
The EA displays its operating state directly on the chart. This includes the daily threshold level, global take-profit line, circuit breaker status, trend direction, cycle status, order count, and dynamic grid distance. A notification overlay appears when the daily threshold has been reached, providing full transparency of the EA's current state.
7. Magic Number System
Separate magic numbers are assigned to BUY and SELL positions for both main and hedge orders. This supports running multiple instances on different accounts without conflicts with other Expert Advisors.
