-
Notifications
You must be signed in to change notification settings - Fork 14
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
API enhancements #30
Comments
Assume my usecase for 20000 conids. |
Hi @dikshantctin thanks for sharing your request. I'm sorry but I'm not entirely sure what are you trying to describe here. Are you making a feature request? Or asking for advice? If you could expand on your example use case in more detail I'd appreciate it. Outline what is the bottleneck or pain point in the current API that you're experiencing and how you'd imagine it improved. |
import os from ibind import IbkrWsKey, IbkrWsClient, ibind_logs_initialize logger = Logger.getLogger(name) Initialize logs (no need to log to a file)ibind_logs_initialize(log_to_file=True) fetching conids from a list of 30000 symbols Function to split conids into batchesdef batch_conids(conids, num_batches): Split the conids into batchesconid_batches = batch_conids(conids, 10) Fields to request market data formarket_data_fields = ['55', '71', '84', '86', '88', '85', '87', '7295', '7296', '70'] Function to process each batch of conids and subscribe to market datadef websocket_subscription_for_batch(conids_batch, redis_key):
if name == "main":
Let meknow if you need help understanding what i am trying to achieve |
@dikshantctin I'm sorry, but I won't be able to understand your request if you only provide the code without deeper written description. Also, please use proper code formatting when sharing code. |
I see that in you usage examples you have are trying to make requests for a few con id's . How should i move forward if i have to use your package to build a scalable solution to work with a universe of securities. For example: consider i am building a portfolio, Also, If you see, i have to make a call-in loop to subscribe to market data for security, or when using the rest client as IB API endpoints only allows us to do that. Will it be possible that we can pass a list of accounts, symbols to do such operations, (adding the functionalities of ib_async package here) If yes How? |
@dikshantctin thanks for expanding with a description.
This heavily depends on what you're trying to do precisely. If you can ask direct questions regarding the areas you'd need help with, we could see if there's anything that can be shared that would aid you.
You can query them from the REST API: https://github.com/Voyz/ibind/wiki/API-Reference-%E2%80%90-IbkrClient#client.ibkr_client_mixins.marketdata_mixin.MarketdataMixin.marketdata_history_by_symbols Or get a stream from the WS API: https://github.com/Voyz/ibind/blob/master/examples/ws_03_market_history.py
Accounts no, you can only work with one account at a time. This is a limitation imposed by the fact that only one session can be authenticated at a time. If you have a gateway with an authenticated session deployed for each account and you can wrangle where the requests are going out to, then you could do it, but it sounds complex. Symbols yes, IBind supports querying multiple symbols at a time.
Which functionalities in particular? Please be specific and outline them in detail. |
Can we have a package to maintain the WebSocket subscriptions , and fetching data made simpler with web sockets for multiple securities and similar for rest api's ,
I've been trying to do the same using async and using multiprocessing to make it faster on my end but cannot come up with a scaleable general utility for my use case.
The text was updated successfully, but these errors were encountered: