Closed 4everlove closed 1 year ago
Hi,
I'm trying to get the open price for SPX, but get nan instead. Here is a snippet
nan
from ib_insync import * ib = IB() ib.connect('127.0.0.1', 4001) spx = Index('SPX', 'CBOE') ticker = ib.reqMktData(spx, '') ib.sleep() print(f'open: {ticker.open}, close: {ticker.close}, last: {ticker.last}') open: nan, close: 4105.02, last: 4100.21
I can also get high and low in the above example. I have the CBOE streaming index data subscription so the feed shouldn't be an issue. Is it something specific to how IBKR handles index products or a bug with ib_insync?
high
low
Thanks!
Probably you'll need to sleep longer, like ib.sleep(4), for the data to come in.
ib.sleep(4)
Thanks, Ewald. Sorry for the late response. Even if i do ib.sleep(100) it doesn't come alive for open. Has it worked for you?
ib.sleep(100)
Hi,
I'm trying to get the open price for SPX, but get
nan
instead. Here is a snippetI can also get
high
andlow
in the above example. I have the CBOE streaming index data subscription so the feed shouldn't be an issue. Is it something specific to how IBKR handles index products or a bug with ib_insync?Thanks!