erdewit / ib_insync

Python sync/async framework for Interactive Brokers API
BSD 2-Clause "Simplified" License
2.83k stars 765 forks source link

open interest for options #259

Closed TonyTang1997 closed 4 years ago

TonyTang1997 commented 4 years ago

Is it possible for us to get the open interest for each option contract? I cannot find it right now in the after reqTickers(contract)

erdewit commented 4 years ago

With the snapshot tickers that are used by reqTickers it's not possible. With streaming tickers it is possible with generic tick 101:

https://ib-insync.readthedocs.io/api.html?#ib_insync.ib.IB.reqMktData

noobymcnoob commented 4 years ago

I've spent 4 days driving myself nuts trying to figure this out. Should've just come here.

drusakov778 commented 4 years ago

@noobymcnoob -the discussion group at https://groups.io/g/insync/topics can be even better

fridary commented 4 years ago

With the snapshot tickers that are used by reqTickers it's not possible. With streaming tickers it is possible with generic tick 101:

https://ib-insync.readthedocs.io/api.html?#ib_insync.ib.IB.reqMktData

This is extremely important question, so it's impossible to get historical open interest data? Like some days/months ago.

jiehunt commented 4 years ago

I am so sorry, i am new in ib API. I also want to get the oepn interest data from market. the code should like this ?

ib.reqMktData(contract, '101', False, False) tiker = ib.tiker(contract) ib. sleep(2)

then , get the openinterest from tiker? but I can get those infor from that. could you please give me a example code ?

thank you very much.

drusakov778 commented 4 years ago

With the snapshot tickers that are used by reqTickers it's not possible. With streaming tickers it is possible with generic tick 101: https://ib-insync.readthedocs.io/api.html?#ib_insync.ib.IB.reqMktData

This is extremely important question, so it's impossible to get historical open interest data? Like some days/months ago.

my understanding is that the answer is no: https://groups.io/g/insync/topic/75312604#4960

and re @jiehunt - you should post how-to questions in the forum, https://groups.io/g/insync