-
Notifications
You must be signed in to change notification settings - Fork 184
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
Connecting to Interactive Brokers REST API (v 3.8.12) #636
Comments
Hi, when running locally (not on Render), you need to have docker installed and running for it to run properly. You're right, we should probably add it to the docs, I'm putting it on my To Do list. Let me know if you face any further issues, I'd be happy to help :) |
Thank you for your feedback, and apologies for the delay in getting back to you. I only just had the chance to review it—needed a bit of holiday time to recharge! 😊 Even with Docker running, I encountered an issue. The latest package I downloaded from PyPI appears to be missing the "resource" directory, which includes the configuration file required for the Docker image. It seems something might be missing in your deployment script. I was able to resolve the issue by manually adding the missing files from the GitHub version, but it might be worth investigating to prevent similar issues for others. Thanks again for your work on this! |
Hi, I’ve experimented a bit more with paper trading using the new connection method to IB, and I’ve noticed several issues that I’d like to highlight. Could you maybe clarify how "mature" this implementation is? Here’s what I observed (3.8.24):
Below the json generated and passed for the bracket orders to IBeam (obvioulsy only the limit main order for each stock and the stock itself don't seems to be included which probably exlplains why the orders are cancelled): [{'conid': 4721, 'quantity': 9.0, 'orderType': 'LMT', 'side': 'BUY', 'tif': 'GTC', 'price': 297.16}, {'conid': 8894, 'quantity': 37.0, 'orderType': 'LMT', 'side': 'BUY', 'tif': 'GTC', 'price': 61.97}, {'conid': 5684, 'quantity': 24.0, 'orderType': 'LMT', 'side': 'BUY', 'tif': 'GTC', 'price': 142.16}] The positions data returned (number of shares per owned stock) seems to be accurate, but the issues above are quite significant for practical use. Let me know if there’s any workaround or if these issues are already being addressed. I’d be happy to provide further details if needed. |
I’ve noticed that the Legacy IB connection is no longer working with version 3.8.24 (and potentially earlier versions—I’m not sure exactly since which version this started). From what I can observe, the create_order() method in interactive_brokers.py is no longer being called. Instead, only the method in order.py seems to be invoked. I haven’t made any changes to my implementation when calling Lumibot, so this behavior appears to be related to recent updates. |
I'm also having issues with all of my limit orders being cancelled. I'm noticing that Cancellation message: lumibot/lumibot/strategies/strategy_executor.py Lines 202 to 213 in 5664f94
|
Hi,
Just tried to switch from the Interactive Brokers Legacy connection to the new method. Getting the following error messages. It seems that it is looking for a running docker ? Nothing is mentioned in the documentation about it ? I only added the IB_USERNAME and IB_PASSORD variables in .env. Without adding ACCOUND_ID and IB_API_URL as mentioned as optional. Am I missing something ?
https://lumibot.lumiwealth.com/brokers.interactive_brokers.html
2024-11-24 16:21:30 | root | INFO | Connecting to Interactive Brokers REST API...
docker: error during connect: this error may indicate that the docker daemon is not running: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/create?name=lumibot-client-portal": open //./pipe/docker_engine: The system cannot find the file specified.
See 'docker run --help'.
2024-11-24 16:21:50 | root | INFO | Not connected to API server yet. Waiting for Interactive Brokers API Portal to start...
2024-11-24 16:21:50 | root | INFO | Waiting for another 10 seconds before checking again...
The text was updated successfully, but these errors were encountered: