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?
Thanks 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?
Thanks Community!!