I'm sure I am missing something basic, but I am having trouble with an apparent mismatch between the stock prices returned by QuantBook.history and the option strike prices returned by QuantBook.GetOptionHistory. When I request options with strikes 1 above and 1 below the underlying price it returns strikes that are both on one side of the underlying price returned by the history method. This is the case even though the returned data indicates the same update time.

def option_universe_filter(universe):
    return universe.include_weeklys().strikes(-1, 1)

def get_option_info(qb, stock, option, open_date):
    open_start_time = datetime.datetime.combine(open_date, datetime.time(15, 40, 0))
    open_end_time = open_start_time + datetime.timedelta(minutes=1)
	
    stock_history_minute = qb.history(stock.symbol, start=open_start_time, end=open_end_time, resolution=Resolution.MINUTE, flatten=True)
    open_underlying_price = stock_history_minute.iloc[-1].close
    print(f'Price of {stock.symbol} at {stock_history_minute.index[-1][-1]} = {open_underlying_price}')
	
    option.set_filter(option_universe_filter)
    option_history_minute = qb.GetOptionHistory(option.symbol, start=open_start_time, end=open_end_time, resolution=Resolution.MINUTE).GetAllData()
    strike_prices = set([i[1] for i in option_history_minute.index if i[1]!=''])
    update_time = set([i[-1] for i in option_history_minute.index if i[-1]!='']).pop()
    assert update_time == stock_history_minute.index[-1][-1]
    strike_prices = sorted(strike_prices)
    print(f'Nearest strikes at {update_time} according to GetOptionHistory: {strike_prices}')


qb = QuantBook()
stock = qb.add_equity('AAPL')
option = qb.add_option('AAPL')
date = datetime.date(2024, 9, 13)
get_option_info(qb, stock, option, date)
Price of AAPL at 2024-09-13 15:41:00 = 221.459315075
Nearest strikes at 2024-09-13 15:41:00 according to GetOptionHistory: [222.5, 225.0]