Ready to Paste Prompt:
I need you to build the core engine for a Moving Average Crossover Expert Advisor in MQL5. Please follow your standard workflow (Plan, Compare, Ask Approval) based on these strict requirements:
Engine: Use two SMAs applied to the close price. Create input variables for Fast_MA_Period (10) and Slow_MA_Period (20).
Entry Logic: Use a strict crossover logic based on closed candles (Index 1 and Index 2). Do not evaluate on Candle 0 (the open candle).
Operational Rules: The bot must only check for signals once per new bar. Include a function to detect a new candle.
Position Management: Only allow ONE open position at a time. Do not open a new buy if a buy is already open.
Exit Logic: Close the existing position if the opposite crossover occurs. Also include basic Input_SL and Input_TP in points.
Review these rules, propose your architectural plan, and ask for my approval to write the .mq5 code.