Thanks for your assistance.
I placed orders to open short on the NZDUSD daily TF.
The entry was just below the bar low and I wanted my code to close the orders if price invalidated the trade by moving above the bar high.
It appeared that my code closed the orders before price moved above the bar high.
Below is a screen shot of where I think the orders were closed.
The red horizontal line shows the invalidation level.
The orange arrow shows the bar that price almost touched but didn't on the 15 min chart until later.
My code closed the orders at this time and I had to reopen the positions again which were soon closed again.
Here is some code:.
if(DeleteOrder==false)Print("An error occurred trying to delete an order: ",GetLastError());
}//End for loop
Did this happen because of the spread?
Should I amend the code something like..
It is better you run and see what happens. Never asks unless it would not run like it should.
However, what I see here is more to logic solutions rather than problems.
for(int i=nTickets; i>0; i--)
Please enable the necessary setting in your browser, otherwise you will not be able to log in.