Open AlexCatarino opened 1 year ago
An algorithm placed limit orders to force getting contract details to cache them and the speed increased. 20 orders that fetched contract details took 3.5 seconds against 1.5 seconds of 20 orders that didn't fetch it.
Expected Behavior
When the algorithm places an order, the contract details should have been cached before.
Actual Behavior
The contract details are fetched before we place the orders. If we subscribe to Interactive Brokers' data, fetch and cache this information on subscribe. On the other hand, if we use an alternative feed, e.g. QuantConnect's, the contract details are requested to IB before the orders are placed.
Potential Solution
Perhaps we could fetch them during the heartbeats.
Reproducing the Problem
Deploy live algorithm with QuantConnect data and place one order to open a position and another to close it. The roundtrip time of the first will be longer. See in the syslog that GetContractDetails is called before the first order.
Checklist
master
branch