Not possible to request bid/ask of an option spread using IB API

Hi Community,

I am coding a trading algo and trying to find a way to pull the bid/ask for a an equity option call spread - in Python using ib_insync.

Code Below:
whatsmyprice = ib.reqTickByTickData(spread_contract, "BidAsk", 0, True)
print(whatsmyprice)

Result:

Error 321, reqId 88: Error validating request:-'bZ' : cause - 'BAG' security type is not supported in ReqTickByTick(97) request, contract: Contract(secType='BAG', symbol='AAPL', exchange='SMART', currency='USD', comboLegs=[ComboLeg(conId=403136034, ratio=1, action='BUY', exchange='SMART', openClose=0, shortSaleSlot=0, designatedLocation='', exemptCode=-1), ComboLeg(conId=403136060, ratio=1, action='SELL', exchange='SMART', openClose=0, shortSaleSlot=0, designatedLocation='', exemptCode=-1)])

However, the TWS system is able to display the bid/ask and midpoint of option spreads in TWS. How can I pull bid, ask and midpoint using ib_insync API or IB API?
upload_2020-3-20_14-21-16.png


Thanks Community!!
 
My coder figured it out. The problem was the ib.reqTickByTickData

Solution:
data = ib.reqTickers(spread_contract)
print('ask_price: ', data[0].ask)
print('bid_price: ', data[0].bid)
 
Back
Top