开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Inconsistent expiry date obtained from ib.reqTickers()


 

I defined option contract as follows :

opt_contract = Option(‘SPX’, ’20250121’, 6015, ‘P’, ‘SMART’, currency=‘USD’, tradingClass=‘SPXW’)

?

Then, I wish to get the contract's current bid/ask prices, so I used reqTickers() as follows :

tick_details = ib.reqTickers(opt_contract)

?

For error tracing purpose, I used to print the tick_details contents. Here it is :

Ticker(contract=Option(conId=750913196, symbol='SPX', lastTradeDateOrContractMonth='20250122', strike=6015.0, right='P', multiplier='100', exchange='SMART', currency='USD', localSymbol='SPXW? 250121P06015000', tradingClass='SPXW'), time=datetime.datetime(2025, 1, 21, 14, 48, 54, 103595, tzinfo=datetime.timezone.utc), minTick=0.05, bid=6.4, bidSize=54.0, bidExchange='C', ask=6.5, askSize=2.0, askExchange='C', last=6.6, lastSize=4.0, volume=2238.0, high=14.05, low=6.45, close=27.7, halted=0.0, bidGreeks=OptionComputation(tickAttrib=0, impliedVol=0.21785950015907832, delta=-0.7116085792422059, optPrice=6.400000095367432, pvDividend=0.0, gamma=0.009767866599599677, vega=0.5477427109390766, theta=-0.0, undPrice=6035.17), askGreeks=OptionComputation(tickAttrib=0, impliedVol=0.22130962943480934, delta=-0.7085997644685299, optPrice=6.599999904632568, pvDividend=0.0, gamma=0.009662509828098607, vega=0.5504154854592325, theta=-0.0, undPrice=6035.17), lastGreeks=OptionComputation(tickAttrib=0, impliedVol=0.2021892365912554, delta=-0.7263385475706803, optPrice=6.599999904632568, pvDividend=0.0, gamma=0.010261604472690885, vega=0.5340398776862891, theta=-0.0, undPrice=6035.17), modelGreeks=OptionComputation(tickAttrib=0, impliedVol=0.21812797350188606, delta=-0.2774263862329315, optPrice=6.0125608711161505, pvDividend=0.0, gamma=0.009575647492098521, vega=0.5376558371343124, theta=-6.0125608711161505, undPrice=6035.34), bboExchange='c70003', snapshotPermissions=3)

?

As seen, the expiry date in my contract definition was 20250121, but the reqTickers() returned 20250122.

I then check IB's contract spec (by right-clicking the relevant contract on TWS and select "Details") and go the following :

?

As seen from the pic, everything is normal, i.e. conId was 750913196, strike was 6015, right was PUT, expiration and last trading date was both 20250121 and the tradingClass was correct (i.e. SPXW).

Anyone had experienced the same and how you solve this issue ? Is there a problem with ib.reqTickers() ? If so, any idea what should be used to replace ib.reqTickers()?

?