[ml]·2025–now

A-R-P

Systematic range-breakout quantitative strategy in MQL5 for USD/JPY with an 8,200+ parameter optimization sweep and Python XML pipeline.

Challenge →Manual, discretionary execution of USD/JPY range-breakouts introduces human timing variance, emotional execution errors, and backtest overfitting.
Outcome →8,200+ parameter sweep analyzed via custom MT5 XML pipeline; top candidate achieved Sharpe 7.64, profit factor 1.24, and 26.8% max drawdown.
Languages:Python · MQL5

Overview

Manual, discretionary trading of USD/JPY range-breakout setups is inconsistent and difficult to validate. Human execution introduces timing, sizing, and psychological variance that makes it nearly impossible to determine whether an identified trading edge is statistically durable or merely market noise.

Asia-POE (YENRange) was developed to transform discretionary Asian session range breakout observations into a fully systematic, programmatic Expert Advisor (EA) implemented in MQL5 and analyzed via a custom Python quantitative pipeline.


Strategic Goals

  • Systematic Execution: Encode the range-breakout logic directly into MQL5 to eliminate human discretion, emotional hesitation, and timing drift.
  • Statistical Edge Verification: Rigorously test whether the strategy exhibits a genuine statistical edge across extensive market conditions rather than relying on an over-fitted backtest.
  • Parameter Frontier Optimization: Identify a robust parameter zone that balances trade frequency, risk-adjusted returns (Sharpe ratio), and maximum capital drawdown.

Technical Challenges & Quantitative Methodology

1. Distinguishing Genuine Edge from Statistical Noise

During a broad 7,576-pass optimization sweep, the single highest-scoring configuration appeared to generate an extraordinary score. Detailed diagnostic inspection revealed it was a one-trade statistical outlier that took advantage of an isolated price spike.

To prevent overfitted artifacts from polluting evaluation, I designed and built a three-stage ranking framework:

  • Hard-Gate Filters: Immediate exclusion of parameter sets that do not satisfy minimum trade frequency thresholds ($N \ge 200$).
  • Composite Scoring: Balanced evaluation of Profit Factor, Recovery Factor, and Expected Payoff.
  • Neighborhood-Stability Checks: Verifying that adjacent parameter values also produce favorable metrics rather than existing on an isolated fragile peak.

2. Multi-Stage Optimization Sweep Architecture

Optimization was conducted across two distinct sweeps comprising over 8,200 parameter combinations:

  • Initial Baseline Sweep (648 passes): Established baseline boundaries for range identification windows and breakout triggers.
  • Exploratory Sweep (7,576 passes): Conducted a wide exploratory rediscovery sweep across broader parameter combinations to identify persistent clusters.

The broader sweep actively narrows the search toward a tightly defined target zone: 380–450 trades, Sharpe ratio between 5.5 and 6.5, and maximum drawdown maintained under 30%.

3. Automated MT5 XML Strategy Tester Pipeline

Standard MetaTrader 5 workflows require tedious manual export and CSV conversion. To streamline analysis, I built a reproducible Python analysis pipeline that parses MT5 Strategy Tester XML exports directly:

  • Extracts trade-by-trade metrics, duration, drawdown curves, and parameter tags.
  • Visualizes risk/reward tradeoffs and parameter-sensitivity heatmaps.
  • Automates outlier detection and exports clean analytical summaries.

Key Achievements & Validated Metrics

  • 8,200+ Combinations Evaluated: Comprehensive parameter space exploration across Asian session hours, buffer offsets, and trailing stops.
  • Top Validated Configuration:
    • Sharpe Ratio: 7.64
    • Profit Factor: 1.24
    • Max Drawdown: 26.8%
    • Trade Sample: 245 trades
  • Automated Python Pipeline: Native XML extraction enabling rapid iteration without manual spreadsheet manipulation.
  • Ongoing Validation: Walk-forward (out-of-sample) validation framework in active development to verify cross-regime durability before live capital deployment.