Thanks leop for your reply. I did use "SPXW" (and always use it) in the tradingClass specification. The following was exactly how I define the option contract :
opt_contract = Option(symbol='SPX', lastTradeDateOrContractMonth='20250116', strike=6005.0, right='C', multiplier=100, exchange='SMART', currency='USD', tradingClass='SPXW')
?
And after ib.qualifyContracts(opt_contract), I print the contents of opt_contract and got the following :
Option(conId=750912933, symbol='SPX', lastTradeDateOrContractMonth='20250117', strike=6005.0, right='C', multiplier='100', exchange='SMART', currency='USD', localSymbol='SPXW ?250116C06005000', tradingClass='SPXW')
?
Then, I tried to find out why the lastTradeDateOrContractMonth between the above two (20250116 vs 20250117) and later I noticed that 202250116 was a trade day where both AM and PM settlement existed for SPX/SPXW. I therefore searched over the web and noticed in Reddit that some traders suggested never trade AM-settled SPX options as the settlement time is set at the morning of next day. As my algo trades 0DTE SPX and expects settlement price to be set at market close on the same day, so this is why I do not want to trade AM-settled SPX options.