Closed Voyz closed 4 years ago
I may be reading this wrong, but this seems to be just going around the issue. It seems like the point is for data_news() to return not None before the code continues.
I cannot seem to get the data_news() function to return anything other than a 404 error "resource not found."
There is a separate issue that might causing the authentication issues. The iserver/account node returns a 500 error if the account is already set.
I agree with @5tomato this is just a workaround. I also agree there are other places in code when this type of issue exists and IMO holistically this type of logic should be reworked in this library. I also couldn't get it to work properly so I stopped using it in the end.
Did you use something else instead?
@5tomato I built my own:
Nice! Looks like you are mostly interested in keeping your session up and running, not necessarily collecting data and executing trades through it?
@5tomato indeed - these two felt like they would be easier to manage if they were decoupled. The Gateway and its startup (eg. IBeam) could live in one place, while the API code could be running elsewhere. Also, using Swagger it is possible to convert IBKR's OpenAPI specification into autogenerated Python API code, so I concluded that it is the Gateway maintenance that requires a bespoke solution more promptly. Btw - if you're interested in collecting data, check out Databay
When the gateway is already running, the data_news doesn't seem to return what was previously assumed. This PR fixes the issue by checking if data_news returned valid data.
fixes #8 fixes #10