@l-andorrà Sorry, it seems that I am back to circle again. I noticed this problem back then and I said in below post.
The MA crossing is dynamic. This means that, for every new bar is formed, the occurrence of crossing is shifted back. How do I make it such that the crossing is fixed as reference? I want that the condition (crossing) to be met once then take action (either open new order or modify order).
@darrow said in Modify pending order after condition met once:
@l-andorrà Below is the updated project. I only changed the buy pending order offset to zero for easier visualization.
https://fxdreema.com/shared/TyrVeu5ub
Example:

The EA is placing the buy stop order and SL correctly after it detects the MA crossing between candle #2 and 3 as well as a followup pullback candle #1.
After 1 candle bar later:

After 1 candle bar later, the buy stop order did not get triggered and was then removed. The EA should place a new buy stop and SL to the new candle #1. However, the EA did not place any order.
I believe this is because the MA crossing condition is not met. After 1 bar later, the MA crossing now occurred between candle #3 & 4 while the EA is tasked to check if there is MA crossing occurring between candle #2 & 3.
More info:
Currency pair: EURUSD
Timeframe: 15 min
Time occur: 2020/01/16, between 9 - 9.15AM
Below shows that there is no new order after the deletion.

I hope this helps explaining my obstacle 