The following code runs perfectly without any error under IB’s paper testing account, but once put it in to run under live account, result was different leading to “Error 478, reqId 227: Parameters in request conflicts….”, roughly saying the expiry date in the request is 20240608 while the expiry date in contract is 20240607.
Here is the extract of the code :
####
Leg1 = Option(“TSLA”, “20240607”, 177, ‘”C”, “SMART”, “USD”)
Leg2 = Option(“TSLA”, “20240607”, 177, ‘”P”, “SMART”, “USD”)
ib.qualifyContracts(leg1, leg2)
ib.sleep(20) # <— I tried from 5, 10, 12 to 20, but still same error
print(leg1.lastTradeDateOrContractMonth)
####
Result of the above print() under Live account :
20240608
Result of the above print() under Paper testing account :
20240607
As 20240607 is Friday (correct expiry for weekly options), apparently 20240608 is wrong.
I thought it was the length of time needed to complete the qualifyContracts() is different in Paper and Live accounts (Live system should be much busier and therefore needs more time to complete), so I tried to lengthen the sleep time from 5,10,12 to 20, but still got same result. Just wonder what other possibilities that made such difference in paper/live systems. Any clue? Contract definition? Any parameters in contract definition needed?
Any help would be much appreciated! Thanks!
Tang Lewis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.