Auftrag beendet
Spezifikation
Hello, I need a semi-automated Expert Advisor (EA) for MetaTrader 5 to trade Gold (XAUUSD). The EA will place two pending orders every morning based on the previous day's high/low and manage the risk dynamically.
--- LOGIC & ENTRY CONDITIONS --- - Every day exactly at 05:59 (broker time), the EA must automatically check for and delete any remaining untriggered pending orders from the previous day to clean the chart. - Then, exactly at 06:00 (Start_Time, broker time), the EA looks back 24 hours and identifies the Highest High (Level 1) and the Lowest Low (Level 0). The distance between High and Low is the "Range".
Exactly at 06:00, the EA must place two new pending orders:
1) BUY STOP at Level 1 (High) - Stop Loss = Level 0.9 (High - 10% of the Range) - Take Profit = Level 1.35 (High + 35% of the Range)
2) SELL STOP at Level 0 (Low) - Stop Loss = Level 0.1 (Low + 10% of the Range) - Take Profit = Level -0.35 (Low - 35% of the Range)
*Important Note: This is a semi-automated system. I must be able to manually delete one of these pending orders from the chart if I decide to trade only one direction. The EA must not re-open the deleted order and must continue managing the remaining one.
--- MONEY MANAGEMENT (PROP FIRM FRIENDLY) --- The lot size must be calculated automatically based on a fixed dollar amount, NOT the current account balance/equity. - The user will input "Initial_Capital" (e.g., 100,000 USD) and "Risk_Percent" (e.g., 1.0%). - The EA must calculate the risk size from this initial capital (100k * 1% = 1,000 USD risk) and always risk exactly this amount, regardless of current account profit or drawdown. - Lot size = (Risk Amount in USD) / (Distance between Entry and SL in points).
--- EXIT & WEEKEND LOGIC --- - Friday Close: On Friday evening at a specific time (Friday_Close_Time, e.g., 22:45 broker time), the EA must automatically delete all remaining pending orders AND market-close all currently open positions. No trades can be held over the weekend.
--- INPUT PARAMETERS REQUIRED ---
- Delete_Time (default: 05:59) -
Start_Time (default: 06:00)
- Initial_Capital (default: 100000
) - Risk_Percent (default: 1.0) -
Friday_Close_Time (default: 22:45)
- Max_Spread_Filter (in points) -
Magic_Number (unique ID for the EA) Please provide clean code and a compiled .ex5 file. Thank you!