IndexOptionSymbol converts holiday-separated last-trading and expiration dates using calendar days
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
Research direction
Start with IndexOptionSymbol.GetLastTradingDate and GetExpiryDate, then inspect how exchange calendars are represented and used by the shared helper. Check the InteractiveBrokersSymbolMapper.GetLeanSymbol IndexOption case and InteractiveBrokersBrokerage.CreateContract; add coverage for the December 2018 holiday in both conversion directions and mapper behavior. Done means those conversions return December 24 and December 26 while ordinary-session and PM-settled results remain correct.
Written by the indexing model from the issue text.
Description
Observed behavior
IndexOptionSymbol.GetLastTradingDate and GetExpiryDate use a fixed calendar-day offset for AM-settled index options. When a holiday separates the last trading session from expiration, both conversions can produce the holiday instead of the correct date.
A concrete case is VIXW expiration on 2018-12-26. Its preceding business day was 2018-12-24, since December 25 was closed. The helpers return December 25 in both directions:
Console.WriteLine(IndexOptionSymbol.GetLastTradingDate(
"VIXW", new DateTime(2018, 12, 26)).ToString("yyyy-MM-dd"));
// Actual: 2018-12-25; expected: 2018-12-24
Console.WriteLine(IndexOptionSymbol.GetExpiryDate(
"VIXW", new DateTime(2018, 12, 24)).ToString("yyyy-MM-dd"));
// Actual: 2018-12-25; expected: 2018-12-26
The fixed +1/-1 behavior is present on master (dbacbd727).
References
- Cboe's settlement archive includes the December 26, 2018 volatility settlement.
- Cboe's 2018 Christmas notice confirms the December 24 options session and December 25 closure.
- Cboe's VIX trading FAQ describes the existing AM-settled VIX last-trading rule as the market close on the business day before expiration, rather than the preceding calendar day.
Affected callers and required result
The public Interactive Brokers integration consumes both conversions:
InteractiveBrokersSymbolMapper.GetLeanSymbol, in theIndexOptioncase, callsGetExpiryDateto construct Lean's contract symbol.InteractiveBrokersBrokerage.CreateContractcallsGetLastTradingDateto populateLastTradeDateOrContractMonth.
Thus this is not only a display-date discrepancy: those callers can construct a different expiration or send a non-trading date when given this holiday-separated contract.
The shared conversions should produce December 24 and December 26 respectively for the reproduction, while preserving existing ordinary-session and PM-settled results. Add holiday-separated cases in both directions and mapper coverage. As a suggestion, resolve these dates against the relevant exchange calendar in the shared Lean helper, so brokerage callers can reuse the correction instead of adding their own holiday rules.
- Dominant language
- C#
- Stars
- 22.6k
- Forks
- 5.4k
- Avg merge
- 11h 39m
- Merged PRs (30d)
- 104
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QuantConnect/Lean
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
QuantConnect/Lean#10216 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
QuantConnect/Lean#10206 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
QuantConnect/Lean#10199 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
QuantConnect/Lean#10198 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
QuantConnect/Lean#10197 ·
Maintainers usually reply within 1 day
All issues in QuantConnect/Lean
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
dotnet-outdated/dotnet-outdated#871 ·
Maintainers usually reply within 1 day
-
triage/untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
unoplatform/uno#26676 ·
Maintainers usually reply within 1 day
-
.NET bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
jhaizhou-ops/S2Arm#2177 · 3 comments ·
Maintainers usually reply within 1 day
-
area-CodeGen-coreclr untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dotnet/runtime#138181 · 1 comment ·
Maintainers usually reply within 1 day