I am using EFS + NT DLL to trade IB TWS accounts. If I enter a long position and a short position, each of them is protected with an stop loss and profit target OCO pair orders. Because both position are of the same size, after orders are entered, actually there is no contracts in the account and there are only four orders being active. In this situation, NTClosePosition("") can not cancel those active orders (which only works when there is no empty position). To cancel those stop loss and profit target orders, I have to use NTCancelAllOrders(). However each time NT pops out an error message "Can't find order with id = xx Attached Order blah blah blah". Since actually all four orders are already cancelled, maybe NT should be smart enough to suppress that error message. Otherwise if I really leave the program running untended, eventually there would be a lot of such message windows shown on the screen and wasting computer resource.
- Clearpicks
Comment