I have a script that automatically closes market orders at 3:58pm. It has seemed to work ok, but today on a large position it only closed part of the order at 3:58.
At 3:58, it sold about 2/3rds of the position. I was watching and noticed the entire position didnt close. I then checked my live orders in MBTrading and found it to be empty. At that point, I manually closed the remainder of the position.
A few seconds later, i noticed that i now had a new live short position in the security! I went ahead and manually closed this also.
When i went back and checked in the NT logs, it appears it generated an order to close part of the position at 3:58. At 3:59, it generated an order to close the remainder of the position. Because i had already manually closed the remainder of the position, it ended up opening a new position.
My question is, why would it have only closed part of the position on the 58th minute? It is a single entry signal and a simple exitlong command i send?
Thanks for your help!
Comment