指定
I am seeking a highly experienced MQL4 developer with deep expertise in high-frequency trading (HFT), tick-level data processing, and execution optimization to modify an existing Expert Advisor (EA) so that its live trading performance closely mirrors its backtesting results.
Core Objective: Backtest-to-Live Execution Parity
The EA currently demonstrates strong profitability and consistency during backtesting, particularly on the XAUUSD (Gold) pair. However, there is a significant performance gap when transitioning to demo and live trading environments. The objective of this project is to identify and eliminate the discrepancies between backtest conditions and real-market execution so the EA behaves as closely as possible to its historical test performance.
Existing Assets Provided
- Full MQL4 source code (.mq4 and compiled .ex4 files)
- Backtesting reports (including modeling quality and trade logs)
- Strategy tester settings used for backtesting
- Screenshots and/or logs of forward testing discrepancies (demo/live)
Key Problems to Solve
The EA performs well in the MetaTrader Strategy Tester but fails to replicate results in real-time trading due to factors such as:
- Slippage and spread variation
- Tick data inconsistency (simulated vs real ticks)
- Execution latency and order fill delays
- Broker-specific execution behavior (ECN/STP differences)
- Requotes and order rejection handling
- Over-optimization to historical data (curve fitting)
- Lack of adaptive logic in volatile gold market conditions
Required Modifications and Enhancements
1. Real Tick Data Handling & Execution Logic Alignment
- Ensure the EA processes real tick data accurately rather than relying on simplified modeling logic
- Synchronize order triggering with real-time bid/ask movement
- Optimize timing logic to prevent missed entries due to rapid price changes
2. Slippage, Spread, and Execution Simulation Integration
- Implement dynamic slippage handling with adjustable tolerance thresholds
- Integrate real-time spread filters to avoid trades during unfavorable conditions
- Add logic to simulate real broker execution behavior within the EA itself
3. Order Execution Optimization (HFT Critical Layer)
- Reduce latency in order placement (optimize OrderSend / OrderModify calls)
- Implement retry logic for failed or delayed executions
- Ensure ECN compatibility (no SL/TP at order send, modify after execution)
- Handle partial fills and execution inconsistencies
4. Broker Environment Adaptation Layer
- Build adaptive logic that detects broker conditions (spread widening, execution speed)
- Normalize performance across different broker types (ECN, STP, Market Maker)
- Add safeguards for trading during high-impact news events (optional but preferred)
5. Tick-Level Strategy Integrity Preservation
- Ensure that trade logic is not altered in a way that deviates from original strategy intent
- Maintain identical entry/exit conditions as backtest while improving execution realism
- Validate that any optimization does not introduce curve fitting
6. Forward-Test Calibration System
- Introduce a self-adjusting mechanism that calibrates execution parameters based on live conditions
- Allow the EA to adapt to real-time volatility and liquidity differences in XAUUSD
- Maintain consistent trade frequency and behavior as seen in backtesting
7. Logging, Diagnostics, and Transparency
- Add detailed logging for:
- Entry/exit conditions
- Slippage encountered
- Execution delays
- Spread at trade time
- Enable clear comparison between expected (backtest) vs actual (live) behavior
Performance Goal
The final deliverable should ensure that:
- The EA’s live/demonstration trading results closely approximate backtest performance
- Trade entries and exits occur at nearly identical price levels (within realistic tolerances)
- Profitability, drawdown, and trade frequency remain consistent with historical results
- The EA is stable under real market conditions, especially for XAUUSD volatility
Developer Requirements
- Proven experience with MQL4 and MetaTrader 4 execution mechanics
- Strong understanding of HFT systems and tick-level trading strategies
- Familiarity with XAUUSD behavior, volatility patterns, and liquidity characteristics
- Experience resolving backtest vs live discrepancies
- Ability to optimize for low-latency execution environments
Additional Notes
This is not a request to redesign the strategy. The goal is to preserve the strategy logic while enhancing execution accuracy and environmental adaptability so that real-world trading reflects backtest expectations as closely as possible.
If successful, this project may lead to further work involving MT5 conversion, multi-broker deployment optimization, and AI-enhanced parameter tuning.
Please include examples of similar work where you have successfully aligned live trading performance with backtesting results.