psemdel/py-trading-bot

Request

Closed this issue · 10 comments

from Discord #Random

polakowo — Today at 9:54 AM
If you know any simple way to call IB and fetch data, I can create a data instance for that process, I'm not familiar with IB tbh

May not be a bad idea to do something like this, would probably make more people aware your awesome project.

Yes, I had the idea too to add a class in VBT. Actually my class IBData(RemoteData) in orders/models already use the right class from VBT. But IB does not use REST request but socker connection, which makes it from the start quite different from the other brokers out there. So I need a kwargs and give it an already created instance of myIB from ib_insync... In addition, in IB one tickers can lead to different products, which is not the way VBT normally works. So right now, it is not good enough to be merged in VBT. But basically, I use the same logic.

Ic. Thanks for providing more detail

I still need to spend more effort on this point. It is feasible. I am reading again VBT code, and my "myIB" can be passed as client. I will give it a try when I find some time.

For info, I am working on it.

Hum, an issue is if I use the same logic as let's say TVData, it connects and disconnects for every downloaded symbol :(

edit: I opened an issue on VBT to find a solution.

Ok, I created a branch here and a branch by vbt. I tested it yesterday and it works. It is quite a big change, but it is definitely a progress. We can wait for the merge from IB side to use it, otherwise, it is also possible to copy the code in the bot. Anyhow, I will beta test it, most probably there are still things to improve.

The branch IBhandling_moved_to_vbt contains the change, as polakowo cannot test IB. But basically it is the same, we just have to move the code there, when he is ready. The hint about beta testing remains valid.

Can you update your code to corresponding vectorbt pro 1.9.0, thanks.