Weared Activity by my EA

 
Hi..My EA is based on daily closing. When I run it first time after the new DAY candle starts it places the orders based on the previous day, I delete those orders and remove the EA and again run it then it places properly what can be the reason? please guide.
 
ismi25:
Hi..My EA is based on daily closing. When I run it first time after the new DAY candle starts it places the orders based on the previous day, I delete those orders and remove the EA and again run it then it places properly what can be the reason? please guide.
Hi

Not enough info sorry. You will need to post your code up
 
But you think it has to do with the code? same code when is run for the second time it works fine.
Reason: