Техническое задание
Professional MT5 Multi-Asset Trading Robot
Realistic Architecture & Practical Characteristics Specification
Below is a filtered, realistic, and practical specification for an excellent automated MT5 Expert Advisor focused on XAUUSD scalping (M1–M15) with multi-asset capability. I've removed marketing fluff and kept only what's technically achievable and profitable in live trading conditions.
CORE IDENTITY
Attribute Specification
Platform MetaTrader 5 (native MQL5)
Primary Asset XAUUSD (Gold)
Secondary Assets XAGUSD, EURUSD, GBPUSD, USDJPY, AUDUSD, US30, NAS100, GER40, USOIL, BTCUSD
Timeframes (Execution) M1, M5, M15
Timeframes (Bias) H1, H4, D1, W1
Trading Style Scalping + Intraday hybrid
Risk Profile Conservative-to-Moderate (0.25%–2% per trade)
1. MULTI-STRATEGY INTELLIGENCE ENGINE (Practical Build)
Rather than 20 modules running simultaneously (which causes conflicts), use a Market Regime Classifier that activates only 1–2 strategies at a time.
Market Regime Detector (runs every new bar)
Uses these inputs to classify regime:
• ADX (Average Directional Index) (14) → trend strength
• Bollinger Band Width → volatility expansion/contraction
• ATR percentile (last 100 bars) → volatility regime
• Higher-high / higher-low structure count → trend vs. range
• Volume delta (tick volume on MT5) → participation
Regime → Strategy Mapping
Detected Regime Activated Strategy Modules
Strong Trend (ADX > 25) Trend-following + Pullback + BOS continuation
Ranging (ADX < 20, narrow BB) Mean reversion + S/R reaction + FVG fill
Volatility Expansion Breakout + Opening Range Breakout
Pre-News / Manipulation STAND DOWN (no trades)
Liquidity Sweep Detected SMC entry (Order Block + MSS confirmation)
Session Open Volatility Momentum + Session breakout
✅ Practical advantage: prevents conflicting signals and overfitting.
2. CONFLUENCE TRADE SCORING SYSTEM (No fake "AI")
A weighted scoring engine — transparent, testable, and tunable.
text
TRADE SCORE COMPONENTS (Total 100)
─────────────────────────────────────────
HTF Trend Alignment (H4/D1).........20
Market Structure (BOS/MSS confirm)..15
Order Block / S&D Zone Reaction.....15
Liquidity Sweep Detected............10
Fair Value Gap Present..............10
Momentum Confirmation (RSI/MACD)....10
Session Timing Bonus................10
Volume / Tick Confirmation..........05
Spread Within Threshold.............05
─────────────────────────────────────────
EXECUTION THRESHOLDS:
≥ 75 → Full size trade
60–74 → Half size trade
< 60 → No trade
3. MULTI-TIMEFRAME TOP-DOWN ANALYSIS
Timeframe Purpose
W1 / D1 Macro bias (bull/bear/neutral)
H4 Swing structure, key zones
H1 Intraday bias + POI (Point of Interest)
M15 Setup formation
M5 / M1 Entry trigger + execution
Rule: Trade only when M5 trigger aligns with H1 + H4 bias. Counter-trend trades require score ≥ 85.
4. XAUUSD SPECIALIZED ENGINE
Practical gold-specific logic:
• ATR (14) on M5 for stop calculation → minimum 1.5× ATR
• Spread filter: reject trades if spread > 35 points (broker-adjustable)
• Kill zones: London 07:00–10:00 GMT, NY 12:30–15:30 GMT
• Avoid zones: 21:00–01:00 GMT (low liquidity, wide spreads)
• News blackout: 15-30 minutes before/after high-impact USD events
• Fake breakout filter: require bar close beyond level + retest confirmation
• Spike protection: ignore any candle > 4× ATR (likely manipulation)
5. SESSION INTELLIGENCE
text
ASIAN (00:00–07:00 GMT) → Range trades, reduced size (0.25%)
LONDON (07:00–12:00 GMT) → Breakout + trend trades (1%)
OVERLAP (12:00–16:00 GMT) → Most aggressive (up to 2%)
NY CLOSE (16:00–21:00 GMT) → Reduced activity (0.5%)
DEAD ZONE (21:00–00:00 GMT) → NO TRADES
6. NEWS FILTER
• Integrates with ForexFactory XML calendar (downloaded daily)
• 30 min before high-impact news → no new trades
• 15 min after → resume with reduced size
• At news time: option to close all, tighten stops, or hold (user choice)
• Tracks: FOMC, NFP, CPI, PPI, Interest Rate decisions, GDP
7. SPREAD & EXECUTION GUARDS
Check Action if Failed
Spread > max threshold Cancel signal
Slippage > 3 pips Reject order
Server latency > 100ms Alert + skip
Requote received Retry 2x then abort
Market closed / freeze level breach – all positions to close at 11.50 EST (New York Timezone) Skip
8. DYNAMIC POSITION SIZING
text
Lot Size = (Account_Balance × Risk%) / (SL_in_pips × Pip_Value)
Where Risk% is determined by:
- Base risk: 0.5%
- + Score bonus: (Score-75)/25 × 0.5% [max +1%]
- - Drawdown penalty: if DD > 5%, halve risk
- - Consecutive losses: reduce 25% per loss after 2nd
- Cap: 2% maximum per trade
9. ADAPTIVE STOP LOSS
• Primary: 1.5× ATR(14) beyond entry
• Structural: beyond last swing high/low (whichever is wider)
• Liquidity-aware: placed beyond nearest liquidity pool (avoid stop hunts)
• Hard cap: never wider than 2% account risk
10. INTELLIGENT TAKE PROFIT (Scaled Exits)
Level Action RR Target
TP1 Close 50% + move SL to break-even 1:1.5
TP2 Close 30% 1:3
TP3 Runner with trailing stop 1:5+
11. SMART TRAILING STOP
Three trailing modes, auto-selected by regime:
• ATR Trail: distance = 1.5× ATR (trending markets)
• Structure Trail: trails behind each new swing point (strong trends)
• MA Trail: uses EMA 21 on M5 (smooth trends)
12. ACTIVE TRADE MANAGEMENT
After trade is live, EA monitors:
• Momentum loss: RSI crosses back through 50 → tighten SL
• Volatility collapse: ATR drops 40% → close partial
• Opposing structure shift: MSS against position → close trade
• Time stop: if trade hasn't moved 0.5R in 30 bars (M5) → close
• Session expiry: close positions 10 minutes before dead zone if not in profit
13. DRAWDOWN DEFENSE SYSTEM (Capital Preservation)
text
Daily DD limit: 4% → stop trading for the day
Weekly DD limit: 8% → reduce risk by 50% next week
Monthly DD limit: 12% → enter recovery mode (0.25% risk only)
Consecutive losses: 4 → pause 24 hours
✅ Hard-coded kill switch — cannot be bypassed.
14. CORRELATION & EXPOSURE CONTROL
• Maintains internal correlation matrix (rolling 30-day)
• Max 2 USD-exposed positions simultaneously
• Max 1 gold/silver position at a time
• Total open risk capped at 4% of account
• Blocks new trade if it increases net directional exposure beyond limit
15. MULTI-ASSET SCANNER
• Scans all configured symbols every 15 seconds
• Calculates trade score per symbol
• Ranks opportunities, executes only top 1–2
• Respects per-asset session validity
16. OPPORTUNITY RANKING DASHBOARD
text
╔══════════════════════════════════════╗
║ EXPER ADVISOR — Live Opportunities ║
╠══════════════════════════════════════╣
║ XAUUSD Score: 88 BUY M5 ✅ ║
║ NAS100 Score: 76 SELL M15 ⚠ ║
║ EURUSD Score: 62 -- -- ⏸ ║
║ GBPUSD Score: 45 -- -- ❌ ║
╚══════════════════════════════════════╝
17. CONTROLLED OPTIMIZATION (NOT True ML)
Realistic approach — avoid overfitting:
• Weekly auto-recalibration of strategy weights based on rolling 30-day performance
• Per-session win-rate tracking → adjusts session aggression factor
• Per-strategy P&L tracking → temporarily disables a strategy if it loses 5 trades in a row
• Manual approval required for parameter shifts > 20%
18. MANIPULATION DETECTION
Specifically tuned for Gold:
• Stop hunt pattern: wick spike > 2× body, reverses within 3 bars → fade signal
• Liquidity grab: sweep of obvious swing high/low + immediate reversal → SMC entry
• Fake breakout: breakout candle without volume confirmation → reject
• Equal highs/lows: flagged as liquidity targets, not entry zones
19. MT5 NATIVE OPTIMIZATION
• Pure MQL5, Object Oriented Programming architecture
• Compatible with tick-level backtesting (99% modeling quality)
• Multi-threaded strategy tester support
• Cloud optimization compatible
• VPS-optimized (low CPU usage, < 50MB RAM)
• Magic number system for multi-instance deployment
20. DASHBOARD (On-Chart Panel)
Section Metrics Displayed
Performance Win rate, Profit factor, Avg RR
Risk Current DD, Daily P&L, Open risk %
Open Trades Symbol, side, score, P&L, SL/TP
Market State Regime, Session, Spread, ATR
News Next event countdown, impact level
Scanner Top 5 ranked opportunities
Controls Pause / Close all / Risk slider
21. REALISTIC PERFORMANCE TARGETS
Metric Realistic Target
Profit Factor 1.6 – 2.2
Win Rate 75% – 80%
Avg Risk:Reward 1 : 2 minimum
Max Drawdown < 12%
Recovery Factor > 2.5
Monthly Return (target) Minimum 50%
Sharpe Ratio > 1.5
⚠️ Reject any EA claiming 90%+ win rate or 50% monthly returns — these are martingale/grid scams.
EXPLICITLY EXCLUDED (DANGEROUS LOGIC) / PROHIBITED / DON’T INCLUDE
❌ Martingale lot doubling
❌ Grid systems without stops
❌ No-SL "hedging" recovery
❌ Revenge / re-entry after stop-out
❌ Fixed lot scaling
❌ "Guaranteed profit" claims
❌ Tick-counting overoptimized indicators
DEPLOYMENT CHECKLIST
Before going live:
1. ✅ Backtest 2+ years tick data on XAUUSD
2. ✅ Forward test 30+ days on demo
3. ✅ Test on 5 different brokers (spreads differ)
4. ✅ VPS with <20ms latency to broker
5. ✅ Start live with 0.25% risk for 2 weeks
6. ✅ Scale up only after 50+ live trades show stable PF > 1.5
WINNING ARCHITECTURE SUMMARY
Regime Detection → Multi-TF Bias → SMC Entry Trigger → Confluence Score ≥ 75 → ATR Risk Sizing → Scaled TP + Smart Trail → Drawdown Guardrails
This is the realistic, professional architecture that institutional-grade retail EAs use. It will not make you rich overnight, but it has a genuine statistical edge and will protect capital — which is what actually matters in long-term trading.