Spezifikation
The EA must be fully automated, backtest-friendly, prop-firm-safe, and built with a clean modular architecture.
Core Strategy Requirements
1. Higher Timeframe Bias
Use D1 and H4.
Use 200 EMA as trend filter:
- If price is above 200 EMA on both D1 and H4 -> allow BUY only
- If price is below 200 EMA on both D1 and H4 -> allow SELL only
- If D1 and H4 are not aligned -> no trade
2. Market Structure Module
Detect and use:
- Higher High (HH)
- Higher Low (HL)
- Lower High (LH)
- Lower Low (LL)
- Break of Structure (BOS)
- Change of Character (CHOCH)
Use a proper pivot/swing-based structure method, not a simplistic candle comparison.
3. Smart Money Concepts Module
Detect and use:
- Liquidity pools
- Equal highs / equal lows
- Liquidity sweeps
- Order Blocks
- Fair Value Gaps (FVG)
4. Confirmation Layer
Use M15, M5, and M3 for confirmation.
Require confirmation from:
- BOS or CHOCH
- Volume spike
- Order Block reaction
- FVG presence
- Strong momentum candle
5. Entry Timeframe
Use M1 for entry.
BUY conditions:
- Higher timeframe bullish bias
- Downside liquidity sweep completed
- Bullish BOS confirmed
- Bullish Order Block present
- Bullish FVG present
- Bullish engulfing candle on M1
- Volume spike confirmed
SELL conditions:
- Higher timeframe bearish bias
- Upside liquidity sweep completed
- Bearish BOS confirmed
- Bearish Order Block present
- Bearish FVG present
- Bearish engulfing candle on M1
- Volume spike confirmed
Filters
6. Session Filter
Allow trading only during:
- London session
- New York session
- London-New York overlap
Block low-volatility sessions.
7. News Filter
Do not trade:
- 30 minutes before and after NFP
- CPI
- FOMC
- Interest rate decisions
- Other high-impact economic news
Use MT5 Economic Calendar if possible.
8. Volume Filter
Trade only if current volume is at least 1.5x average volume of previous candles.
9. Volatility Filter
Use ATR(14):
- avoid low volatility
- avoid extreme volatility
10. Spread Filter
- Maximum spread allowed: 30 points
- Skip trade if spread exceeds limit
11. Slippage Filter
- Maximum allowed slippage: 20 points
- Avoid/cancel entry if slippage exceeds limit
Risk Management
12. Risk Rules
Inputs required:
- Risk per trade: default 1%
- Daily max loss: 3%
- Weekly max loss: 6%
- Maximum trades per day: 3
- Maximum consecutive losses: 2
Stop trading for the day after:
- 3% daily loss
- 2 consecutive losses
13. Lot Size
- Auto lot calculation based on account balance and risk percentage
14. Stop Loss
- Place SL behind recent swing high/low
- Add ATR-based buffer
15. Take Profit
Need 2 targets:
- TP1 = 1:2 Risk Reward
- TP2 = next liquidity zone
16. Trade Management
- Move SL to break-even at 1:1 RR
- Close 50% position at TP1
- Trail remaining position using ATR trailing stop
Score Engine
17. Confidence Score
Create score from 0 to 100.
Suggested weighting:
- Trend Alignment = 20
- Market Structure = 15
- Liquidity Sweep = 15
- Order Block = 10
- FVG = 10
- Volume = 10
- Session = 5
- ATR Filter = 5
- Spread Filter = 5
- Momentum Candle = 5
Only execute trades if score >= 85
Prop Firm Safe Mode
18. Protection
Need:
- Daily drawdown protection
- Equity protection
- Automatic shutdown after max loss
- Prop firm challenge compatible logic
Alerts and Notifications
19. Alerts Required
Send notifications for:
- Trade opened
- Trade closed
- Daily loss limit reached
- News filter active
Support:
- MT5 terminal alerts
- Push notifications
- Telegram notifications optional
Code / Delivery Requirements
20. Architecture
Please build with modular files:
- MainEA.mq5
- TrendFilter.mqh
- MarketStructure.mqh
- Liquidity.mqh
- OrderBlock.mqh
- FVG.mqh
- VolumeFilter.mqh
- SessionFilter.mqh
- NewsFilter.mqh
- RiskManager.mqh
- TradeManager.mqh
- TrailingStop.mqh
- ScoreEngine.mqh
21. Quality Requirements
- Clean and optimized MQL5 code
- No duplicate trades
- One trade per signal
- Stable partial close logic
- Proper magic number handling
- Good state management
- Backtest friendly
- Must compile without errors in MetaEditor
- Fully compatible with MT5
22. Deliverables
Please provide:
- Full .mq5 and .mqh source files
- Clean compile with no errors
- Well-grouped input settings
- Brief setup guide
- Backtest-ready version
- Explanation of any limitations/approximations used in SMC logic
Important Note
I do not want a basic EMA robot. I want a professional institutional-style XAUUSD EA with proper multi-timeframe logic, smart money concepts, strong filtering, and prop-firm-safe risk management.
Please confirm before starting whether M3 timeframe handling, MT5 Economic Calendar, partial close logic, and Telegram alerts will all be included in the first delivery or in later revisions.
Agar chaho to title ke neeche ek aur line add kar do:
Please share examples of previous MT5 EAs, especially any Smart Money Concept or prop-firm-safe projects.