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

Having some trouble with IBKR module - historical feed and charts printing #73

Open
giabaocorn20 opened this issue Jan 27, 2024 · 8 comments

Comments

@giabaocorn20
Copy link

giabaocorn20 commented Jan 27, 2024

Hello,

I've been testing the functionality of the IBKR module and have noticed a couple of discrepancies. While everything seems to be working fine, I've encountered issues with the historical data feed not being displayed in the notebook, even though I can see API messages being sent to the IB Gateway. Additionally, the charts are not appearing as expected.

I've set up a paper trading account and successfully logged in using the provided username and password. Despite this, the historical data isn't showing up in the notebook, and the charts are not being printed.

Could you assist me in troubleshooting this matter?

The API responds to the call
Screenshot 2024-01-27 142009

But there is nothing being printed out. Just an empty []
Screenshot 2024-01-27 142033

The charts aren't being created as well
Screenshot 2024-01-27 142047

Thank you.

@jbaron
Copy link
Collaborator

jbaron commented Jan 27, 2024

Which version are you using of roboquant? The historic data is perhaps related to issue #69, but that is only fixed in the 2.2.0-SNAPSHOT release.

@giabaocorn20
Copy link
Author

Hi,
I'm using the 2.2.0-SNAPSHOT release version. and for the rest, I did exactly the same as the example on jupyter notebook

@jbaron
Copy link
Collaborator

jbaron commented Jan 28, 2024

I just did a quick test, and no problems retrieving historic data:

val feed = IBKRHistoricFeed()

// This assumes you have a valid market subscription for US stocks
val symbols = listOf("TSLA", "GOOGL", "JPM")
val assets = symbols.map { Asset(it, AssetType.STOCK, "USD", "") }
feed.retrieve(assets)
feed.waitTillRetrieved()
println("historic feed with ${feed.timeline.size} events and ${feed.assets.size} assets")
feed.disconnect()

Same as you, I see all the data logger in the IB Gateway. So in your case, it is not a subscription issue I guess.

Is there any output on the console that something goes wrong?

@jbaron
Copy link
Collaborator

jbaron commented Jan 28, 2024

Also tried the IBKR notebook and is also working. See screenshot below for the first few cells in the notebook (using Jupyter-Lab btw).

Screenshot 2024-01-28 at 20 11 46

@giabaocorn20
Copy link
Author

Hi, thank you for your help. I tried to run the code that you sent me. Apparently the historic feed has 0 events and 0 assets.
Screenshot 2024-01-28 152220
and the console printed out a warning like this, i dont know if its the reason affect this historical feed or not?
Screenshot 2024-01-28 151324
FYI: I am running using IB Gateway 10.27

@jbaron
Copy link
Collaborator

jbaron commented Jan 28, 2024

Possible version differences?

For IBKR I run 10.19, both the installed TWS API and IB GW. For the TWS API, this is also the stable version.

@giabaocorn20
Copy link
Author

Hello,
Yes, i just downloaded the 10.19 version and I think it's give better information that the 10.27 version. As it told that i didn't have a valid data subscription. However I'm currently experiencing an issue with the data subscription for Canadian stocks on the 10.19 version of the platform. Despite having an active subscription for the Canadian Security Exchange (CSE), I'm encountering a message indicating a lack of data subscription for this market.

I've attempted to implement the following code:

val symbols = listOf("TRUL")
val assets = symbols.map { Asset(it, AssetType.STOCK, "CAD")}

val feed = IBKRHistoricFeed()
feed.retrieve(assets)
feed.waitTillRetrieved()
println("Historic feed with ${feed.timeline.size} events and ${feed.assets.size} assets")
feed.assets

However, I'm still receiving a notification stating that there is no data subscription. I suspect there might be an issue with how I've mapped the assets. Could you please assist me in reviewing the asset mapping for Canadian stocks? Additionally, I recommend updating the link from IB Gateway in the Jupyter notebook, as it currently directs to the 10.27 version instead of the 10.19 version.

Your help in resolving this matter is greatly appreciated. Thank you for your assistance.

@jbaron
Copy link
Collaborator

jbaron commented Jan 29, 2024

I remember there is some IBKR account setting that you want to share you data-subscription with the paper-trade account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants