Devils Advocate MT5
- Experts
-
Kelvin Kioko Kaambi
My name is Kelvin Kaambi. I've spent four years trading systematic mechanical strategies, and the past year automating them for MetaTrader 5, with a focus on XAUUSD. Trading a mechanical system by hand teaches you things a backtest never will: where the rules break down, how execution actually - Version: 2.103
- Updated: 4 October 2026
- Activations: 20
Devils Advocate MT5
Grid trading has a bad reputation among experienced and professional traders, and much of it is deserved. Devils Advocate is my deliberate challenge to that consensus. I set out to prove that a grid system, built with discipline and the right safeguards, can hold a real edge. The result is a trend-following grid Expert Advisor designed exclusively for XAUUSD. It combines a trend-aware engine with multiple layers of capital protection, so it trades with gold's momentum rather than against it.
Key Features
- Fully automated trend-following grid trading for XAUUSD
- No Martingale on default settings
- Optional Adaptive Martingale with conservative lot scaling
- Multiple risk management modes
- Margin Level Protection with user-defined close-out levels
- Percentage drawdown limits
- Friday close to avoid weekend exposure
- Built-in high-impact news filter (FOMC, NFP & CPI)
How It Works
Devils Advocate draws on 29 indicators across multiple timeframes. Rather than requiring every indicator to agree, it uses a scoring system that weighs their readings to identify optimal trading conditions. Five moving averages of different types track trend alignment from the short term up to higher timeframes, while adaptive averages (AMA, DEMA, TEMA, FrAMA and VIDyA) pick up trends early and filter out noise. Parabolic SAR, Ichimoku, Alligator and ADX confirmed trend structure and strength. Bollinger Bands, Envelopes, ATR and Standard Deviation measure volatility, while RSI, Stochastic, CCI, MACD, OsMA, Momentum, Williams %R, MFI and Force Index confirmed momentum and market participation. The indicators set the context, but the signal engine itself is built on a complex interplay of price action and time.
How I Developed It (Concerns About Overfitting)
Twenty-nine indicators invite an obvious objection: overfitting. With that many inputs, weightings and thresholds to adjust, anyone can produce a near-perfect backtest equity curve in an hour or less. The result is a history reader, a system that describes the past beautifully but predicts nothing, and it falls apart the moment it goes live. That's why the indicators were never the edge in Devils Advocate. They define context, while the real work happens in the signal engine, a complex interplay of price action and time that decides how and when to act within that context. A perfect backtest is easy to build; an engine like this is not easy to replicate. The development methodology provided the difference, testing not just whether the engine performs, but whether the context layer genuinely improves its decisions or simply memorizes history.
Parameters were first set on a defined in-sample window, a result that carries no obvious weight on its own. The real test was the out-of-sample period that followed, with the signal engine's parameters and the scoring system's weights and thresholds locked and no further tuning allowed. An overfitted model, a history reader, degrades sharply at exactly that boundary. This one didn't, and that is the only reason development continued.
From there came the standard robustness work:
- Parameter sensitivity analysis. A viable parameter set sits on a plateau, not a spike. When engine inputs, indicator settings and scoring thresholds were adjusted, performance had to taper off gradually rather than collapse.
- Walk-forward analysis. Rolling optimization and validation windows were advanced across the full history to test whether the edge persists as markets change, not just whether it existed once.
- Monte Carlo simulation. Trade sequences were randomized across thousands of iterations to map the full distribution of outcomes rather than a single historical path. The tails are what matter here: worst-case drawdown and probability of ruin directly shaped the minimum deposit and default risk settings shipped with the EA.
- Execution stress testing. Spread, slippage and commission assumptions were widened well beyond typical broker conditions to confirm the edge doesn't rely on idealized fills.
- Regime segmentation. Trending, ranging and high-volatility periods were analyzed separately. This confirmed that strong aggregate results weren't hiding a strategy that only works in one market state, and that the scoring system was correctly identifying which conditions favor the signal engine and which call for standing aside.
- 2026 incubation. All 2026 data was excluded from every stage above and never used for fitting or validation. Instead, the EA ran on a demo account in real time since January 2026, under live spreads and real execution, against price action it had never seen.
The results held. I'm confident it's ready for live deployment, and time will be the judge.
Risk Management
I built in multiple risk modes to suit both conservative and more aggressive trading styles. By default, no martingale is used. For traders who want faster basket recovery, the optional Adaptive Martingale can be enabled. Unlike traditional martingale systems that double lot sizes, it applies conservative multipliers across grid layers, keeping exposure growth controlled.
Capital protection works at several levels. Percentage drawdown limits cap how much of the account any basket can put at risk. Most importantly, the Margin Level Protection system continuously monitors your margin level and closes all positions if it falls to 150% , or any other level you set, well before a broker margin call. The Friday close feature shuts down trading before the weekend so baskets aren't exposed to weekend gaps, and the news filter avoids trading on FOMC rate decision, NFP, and CPI days.
Setup Requirements
- Instrument: XAUUSD (Gold)
- Timeframe: M15
- Minimum Deposit: 750 USD
- Leverage: 1:400 or higher
- Account Mode: Hedging
- VPS: 24/7 VPS required. As a grid EA, Devils Advocate must stay connected at all times to manage open baskets and its protection systems. Downtime is riskier for grid strategies than for most other EAs.
Recommended Brokers: Vantage Markets (Raw ECN) and VT Markets (ECN)
All development work on Devils Advocate was done using Vantage Markets Raw ECN and VT Markets ECN accounts. The historical data used for training and optimization, as well as the parameter sensitivity analysis, came from those two feeds. For that reason, those are the brokers I recommend.
Devils Advocate will run on any broker offering raw spreads, but it is specifically optimized around the spread, execution and pricing characteristics of Vantage Markets and VT Markets. Gold pricing and execution quality differ meaningfully between brokers, and a strategy tuned on one feed may not behave identically on another.
These are recommendations, not requirements. If you trade with a different broker, backtest extensively on your own feed and compare the results against Vantage and VT Markets. That comparison will show you whether there is any meaningful difference or trade-off on your side, and it's worth doing before you commit real capital.
How to Use
- Enable Algo Trading in MT5.
- Attach Devils Advocate to an XAUUSD M15 chart.
- Select your preferred Risk Mode and decide whether to enable Adaptive Martingale.
- Set your Margin Level Protection and drawdown limits.
- Leave remaining settings on default unless customization is required.
Recommended Practices
- Backtest thoroughly before going live. I strongly recommend running comprehensive backtests in the MT5 Strategy Tester using "Every tick based on real ticks" mode. Watch how baskets are built and closed, how drawdowns develop, and how the protection systems respond in different market conditions, so you know what to expect before real money is involved.
- Run it in its own account. Grid EAs carry a different risk profile from other strategies and should be kept in a separate portfolio. I recommend opening a dedicated account and running Devils Advocate alone, without other EAs or manual trades. Margin Level Protection and drawdown limits are calculated on the whole account, so other positions can distort them, and a protective close-out may also close trades that aren't Devils Advocate's.
- Attach to one chart only. Running multiple instances on the same account multiplies exposure beyond what I designed the risk settings for.
- Start conservatively. Begin with default settings and Adaptive Martingale disabled until you're familiar with how the EA builds and closes baskets.
- Don't interfere with open baskets. Avoid manually closing individual grid positions, changing settings, or restarting the EA while a basket is open, as this can disrupt basket management.
- Use a low-spread account. Grids open multiple positions, so spreads and commissions add up quickly. I strongly recommend a raw spread or ECN account.
- Withdraw profits regularly. Periodically taking profits out of the account locks in profits and limits how much capital is ever exposed.
- Only trade capital you can afford to lose. Size your account for the risk of a grid strategy, not for its best months.
Disclaimer: Devils Advocate is provided on an "as-is" and "as-available" basis without any express or implied warranty, including warranties of profitability or fitness for a particular purpose. Grid strategies carry specific risks, including the possibility of large drawdowns during extended adverse moves. Trading Forex and CFDs involves substantial risk and may result in the loss of your invested capital. Past performance from live trading, demo incubation, backtests, or strategy tester results does not guarantee future performance. I accept no liability for financial losses, broker execution issues, slippage, VPS downtime, connectivity failures, or any damages arising from the use of this software. By purchasing and using Devils Advocate, you accept full responsibility for your trading decisions and compliance with the laws and regulations applicable in your jurisdiction.
