Before posting please read some of the other threads . . . then you would have seen numerous requests like this one:
one trade is placed and "total" which is OrdersTotal() remains at 1 even though the trade has exited - I have restarted MT4 and it is still 1.
Closing the terminal does not close trades. so restarting is irrelevant
It's one because you have an open order. open terminal (control-t) trade tab.
I have updated the code above
I have read the numerous posts you are referring to - they seem to be stuck at 0 not 1. I have read them thoroughly and could not rectify my probelm
I looked at the Trade Window and the 1st trade seems to already closed out - Right click on the order and the option to close out the trade is greyed out