Техническое задание
MetaTrader 5 Expert Advisor
Manual Start – Auto Hedge – Dynamic Lot Sequence – Price-Based SL/TP
1. Platform & Account
- Platform: MetaTrader 5
- Account type: Hedging
- Broker: Exness
- Must work on Cent and Standard accounts
- Symbol: XAUUSD
- Must support different symbol digits automatically
2. First Trade (Manual Only)
- EA must NOT open the first trade
- First trade is opened manually by the trader
- Direction: Buy or Sell
- Lot size: chosen manually by the trader
- EA starts only after detecting this manual trade
3. Lot Sequence (Input Parameter Only)
Example:
LotSequence = "0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.10,0.11,0.12,0.13"
Rules:
- EA detects which lot from LotSequence was used manually
- EA continues from the next lot in sequence
- Each Stop Loss -> next lot
- Any Take Profit -> reset to first lot
- If last lot is used and TP not hit -> stop opening new trades
- No martingale formulas
- No x2 / 4-3 logic
- No balance-based lot calculation
4. Stop Loss & Take Profit (Price-Based)
For XAUUSD:
- Take Profit = +4.00 USD price movement
- Stop Loss = -3.00 USD price movement
Must work on:
- Cent accounts (~4000 / 3000 points)
- Standard accounts (~400 / 300 points)
Use:
- SYMBOL_POINT
- SYMBOL_DIGITS
- SYMBOL_TRADE_TICK_SIZE
Do NOT hardcode points.
5. Core Trading Logic
- Manual trade gets TP +4.00 and SL -3.00
- At SL price place opposite pending order
Buy -> Sell Stop
Sell -> Buy Stop
- Pending order lot = next LotSequence value
- Pending order also has TP +4.00 and SL -3.00
- SL price is always the same as next pending order price
6. Stop Loss Continuation
- If SL is hit, pending order becomes market order
- EA moves to next lot
- EA sets TP/SL
- EA places next opposite pending order at SL price
- Continue until TP hit or LotSequence ends
7. Take Profit Reset
- If any trade hits TP:
Close all open and pending orders
Reset lot index to first lot
Open new trade in TP direction with first lot
8. General Settings
- Magic Number input
- Slippage input
- Max Spread optional
- Enable/Disable EA
9. Technical Requirements
- Pure MQL5
- Clean, commented code
- No DLL
- No indicators
- No hidden logic