Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetContractDetails Delay Order Execution #48

Open
4 tasks done
AlexCatarino opened this issue Dec 22, 2022 · 1 comment
Open
4 tasks done

GetContractDetails Delay Order Execution #48

AlexCatarino opened this issue Dec 22, 2022 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@AlexCatarino
Copy link
Member

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

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
@AlexCatarino AlexCatarino added bug Something isn't working enhancement New feature or request labels Dec 22, 2022
@AlexCatarino
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant