Closed phcchan closed 1 year ago
During TWS login, choose timezone=Asia/Shanghai
The lastTradeDateOrContractMonth
can be sent either with or without timezone string. There is no automatic timezone conversion in the wrapper.
I would suggest to use choose UTC for the TWS login and to use UTC throughout the code base.
Version: TWS 10.19.2a, ib_insync 0.9.85
During TWS login, choose timezone=
Asia/Shanghai
UTC+8 (US/Eastern
is UTC-4 or UTC-5). Below is a minimal code to reproduce the issue:In case the weekly option is invalid (expired), any soon expired weekly option contract would produce the same issue.
I believe the issue is originated from
ib_insync/decoder.py
line 327 during handling thelastTimes
. For the montly option,lastTimes
reads'20251219'
; while for the weekly option, it reads'20230624 04:00:00 Asia/Shanghai'
.