Bug in OrderClose --> OpenOrder circle

 

Hi,

can someone help me please?

Need some code for following case:


"If EA gets his signal, open for example BUY + SELL STOP order

If one of both runs into TP, close all other open orders."


As soon as there are no remaining orders on the chart, restart again with above mentioned flow..., means wait for your signal and run...


My Problem is, I use "if history order --> OrderProfit()>0 --> close/delete   ----> if no OpenOrders() place new order(s)

BUT at this point, the history order is of course still in profit and he delete/close the new sent orders (and thats what he shouldn'T do, he should wait until one of the new orders run again in TP)

Hope It's understandable as I'm new in MQL4 programming and my english is not the best