I encountered the problem with high volatile pairs (f.e. XAUUSD) that the EA opens up a trade as it should, but when my TP was hit within the same candle, it opened up another trade immediately.
For Example:
The EA should open a buy trade if the X EMA and Y EMA crossed to the upside on candle close id 1.
Now, my trade opened, reached TP within some minutes, but checked the condition again and opened up another trade since the condition is still true.
So I added the counters that the EA opens up just one trade per change of short-time trend and the counter will reset after the EMAs cross again in the other direction.
Question:
Does the "check profit (unrealized)" work on demo account? That is one thing I imagine could cause the trades not to close ...
Thanks for your relply!