Closed reservoirinvest closed 9 months ago
It looks like Leap Year is not the issue.
Could be solved reconstructing the option contract, using ContractDetails.realExpirationDate
instead of lastTradeDateOrContractMonth
.
However, an easier way, as suggested here , is to change the timezone to US Central Time
.
I have some option positions in my portfolio and extract it using the following function:
when an option contract in df_pf is qualified using
ib.qualifyContracts
, it works fine and gives me, like this one below:Contract(secType='OPT', conId=679139121, symbol='ABNB', lastTradeDateOrContractMonth='20240217', strike=124.0, right='P', multiplier='100', exchange='SMART')
. Note that the expiry date is wrong. ref: this yahoo link... but when I remove the
conId
, the qualifyContracts fails and it gives me anUnknown contracts
error.... running the wrong expiry dated conId contract through
ib.whatIfOrderAsync(wrong_expiry_dt_contract, Order('SELL', 100))
throws the undocumented Error 478 exception:Parameters in request conflicts with contract parameters received by contract id: requested expiry 20240217, in contract 20240216;
I don't get the error in options expiring in March 2024.