Since two weeks ago, I have an Algo working flawlessly with a little real money account in IB since it's still an experiment Algo. Technically, it has performed as designed, however this early morning, all of sudden, an inexplicable error pop up. First, I'm going to explain the flow of events.
The Algo had a short position of 3 contracts in MES ( Micro-Emini ), then at 3.58.50 am, the Algo needs to reverse position to a new LONG position. So, first, it has to submit an order to close the Short position, then, when it's filled, it waits until IB updates net position, so afterward it submits the remaining order to open the LONG position. It's pretty straightforward and for two weeks it has worked just fine. But this morning happened the following: the Algo closed the Short, but something happened in the update of net position between IB or NT, when the new LONG order position is submitted, IB rejects it cause margin for 6 contracts !! , because IB believes that the Algo is already LONG with 3 contracts, which is not true, it's just flat.
The error is so weird that I suspect that it might possibly be some issue in the database, so I performed a reset database and back to work, but I'm very uneasy cause perhaps it's something else with a potential repetition. What do you see and what is the solution?
Thanks!
Comment