← Back to Portfolio
MQL5
MetaTrader 5
Python
Backtesting
Trading Bot
MT5 Automated Trading Bot
Custom MetaTrader 5 Expert Advisor for an independent trader — dual-indicator strategy with configurable risk management and a full Python backtesting framework.
Private (Client EA)
Overview
Built a fully automated Expert Advisor for an independent trader who needed a reliable MACD + Supertrend strategy running on MetaTrader 5. The client had specific entry/exit rules, risk parameters, and multi-timeframe requirements that needed to be coded precisely into MQL5.
Beyond the EA itself, I built a companion Python backtesting framework to validate the strategy across multiple timeframes and instruments before going live — giving the client confidence in the system before risking real capital.
Key Features
- MQL5 Expert Advisor with MACD crossover + Supertrend trend filter for entry signals
- Configurable risk management — lot sizing as percentage of balance, stop-loss, take-profit, trailing stop
- Multi-timeframe support with independent strategy parameters per timeframe
- Python backtesting suite for historical validation using real OHLCV data
- Parameter optimization workflow to find best-performing configurations across instruments
- Clean trade logging for post-session analysis and performance tracking
- Spread-aware simulation in backtests for realistic performance estimates
Technical Details
- MQL5 with proper error handling for order execution, position management, and broker-specific edge cases
- MACD histogram analysis for momentum detection, Supertrend overlay for trend confirmation — signals only fire when both agree
- Risk per trade calculated dynamically from account balance with user-defined percentage caps
- Python backtest engine using pandas for data processing and trade simulation with configurable slippage and spread
- Strategy validated on multiple pairs and timeframes (5min, 15min, 1H) to confirm robustness before live deployment
Tech Stack
MQL5
MetaTrader 5
Python
pandas
OHLCV Data
Backtesting Framework
Outcome
Delivered the EA with full documentation and the backtesting suite. The client tested it on their own data, confirmed it matched their trading rules, and released payment the same day. They've since come back for additional strategy work — the kind of repeat engagement that comes from getting the details right the first time.