So, I have a strategy running using unmanaged approach and it is finally working properly using multi-thread (trickier than I thought, that multi-thread). No errors/overfills on high pace tick data. It is set to "Keep Running" on disconnection and handles fine on connection loss, but something bothers me. (Broker: IB. Tests done on: IB's Paper Acct).
What happens during the following hypothetical scenario, however unlikely:
1. Inside Ninja Strategy: Call SubmitOrder(). Market Order.
2. Order State says Pending Submit.
3. Disconnection for 10 minutes. We don't get any Accepted or Working states.
4. Meanwhile, Broker received the Market Order. Fills it. But we don't get any updates...as we are still disconnected.
5. Connection comes back online.
6. ??? What happens here?
So, my questions are concerning step 6:
1). After 10 minutes in the dark, will we receive a Filled Order state? maybe the broker sent it, while we were disconnected...so now, we don't get a Filled order state update?
2). After 10 minutes in the dark, will OnPositionUpdate() get a broker communicaton? The documentation doesn't really mention if that method ever communicates with the broker. Does it? How often?
2.5). If it does communicate, I assume Position.MarketPosition and Position.Quantity inside OnBarUpdate() will update just the same? (I know asynchronously)
Thank you for your time,
Xraider.
Comment