指定
OFFICIAL MQL5 SOFTWARE REQUIREMENTS SPECIFICATION (SRS)
Project Name: "Quantum-Shield 2.0" Institutional EA
Platform: MetaTrader 5 (MT5)
Execution Logic: Fully Automated
Instrument: GER40 (DAX)
Timeframe: 10 Minutes
1. ARCHITECTURAL MANDATE The Expert Advisor must be a monolithic, high-performance C++ based MQL5 application. No DLLs, no external python bridges. The logic must be entirely self-contained.
2. SIGNAL GENERATION (THE DUAL-LOCK PROTOCOL) A trade entry signal is valid ONLY when BOTH conditions are true on the close of a 10m candle:
-
Directional Filter: Current price > 200-period Exponential Moving Average (EMA) for LONG; Current price < 200-period EMA for SHORT.
-
Momentum Trigger: MACD (12, 26, 9) Main line crosses the Signal line. Cross-up for LONG; Cross-down for SHORT. (Note: There is NO ADX filter in this system).
3. TRADE MANAGEMENT & MATHEMATICAL EXIT
-
Stop Loss (SL): Fixed at 1.5 x ATR(14) of the entry candle.
-
Take Profit (TP): Fixed at 3.0 x ATR(14) of the entry candle. (Strict 1:2 Risk/Reward ratio).
-
Order Execution: Market orders only. The EA must handle "Requotes" and "Slippage" with an asynchronous retry loop (max 3 retries).
4. DYNAMIC RISK MANAGEMENT (ACCOUNT PROTECTION) The position size (Lot) must be calculated dynamically for every trade based on the following logic:
-
Risk per Trade: 1.0% of Current Account Equity (Input parameter).
-
Lot Size Calculation: Risk_Amount / (SL_points * Tick_Value) .
-
Maximum Loss Protection (Hard Stop): If Account Equity falls below $96,000 (Input parameter), the EA must immediately close all open positions, cancel all pending operations, and disable itself permanently.
5. PROP FIRM COMPLIANCE MODULES
-
Module A (Order Splitter): If the calculated Lot size exceeds 20.00, the EA must split the execution into multiple orders (e.g., 35.0 lots -> 20.0 + 15.0).
-
Module B (Anti-Spam Delay): Split orders must be sent with a randomized 250ms–750ms delay between each execution to avoid "Order Book Spamming" flags.
-
Module C (News Shield via WebRequest): * Must include an Input parameter: Use_News_Filter = true/false .
-
When true, the EA fetches high-impact (RED) news for USD/EUR via a reliable calendar (e.g., ForexFactory RSS/JSON). Trading is strictly forbidden ±15 minutes around RED news events. If the feed fails, default to Fail-Safe (No trading).
-
6. OPERATIONAL CONSTRAINTS (CRITICAL TIME RULES)
-
Trading Window: 09:00 - 15:30 (Broker Server Time). The EA must NOT open any new positions outside this window.
-
End of Day Hard Close: At exactly 15:30 Broker Time, the EA MUST close all open positions at Market Price, regardless of current P&L. No overnight holding, no weekend holding.
-
Source Code: The developer must deliver the original .mq5 file.
-
Safety: The EA must check for TerminalInfoInteger(TERMINAL_CONNECTED) and MQLInfoInteger(MQL_TRADE_ALLOWED) before every operation.