I am converting my backtesting algorithm to Live. I know there are two main areas I have to address:

  1. Collecting history to build up my indicators prior to processing live candles. This seems pretty straightforward and I can test it.
  2. Dealing with broker disconnects. Worst case is, a Stop or Limit order gets filled during the disconnect, and I have to reconcile the status of open orders between my code and reality. Which raises two questions:
  • After a disconnect/reconnect will QuantConnect be out of sync with the broker? For instance, if I query an order status, will QC show me incorrect information? Or will it query the broker?
  • Realistically I don't see how I will be able to test this code - reconciling order status after a broker disconnect (or a program restart). I would really love to see some working code that handles this, if anyone can provide that.

Thank you.