### **Initial conditions:** trade opens in sell position 3033 - **Symbol:** Gold (XAUUSD) - **Current price:** 3033 - **Lot size:** 0.01 - **Take Profit (TP):** 3032 - **Stop Loss (SL):** 3034 - **Price at account closing:** 3032(for example, the account is closed due to reaching Take Profit). --- ### **What the EA should do:** 1. **Following the closed order:** - The EA detects that the account is closed at the price of 3032 (Take Profit). 2. **Checking the current price:** - The EA checks the current price of gold after closing the account. For example, the current price is now 3032. 3. **Decision to open a new pending order:** - Since the current price (3032) is **lower ** than the price of the closed order (3033), the EA should open a **Sell limit ** pending order. - **Price:** 3033 - **Lot size:** 0.01 - **Take Profit (TP):** 3032 - **Stop Loss (SL):** 3034