Future option tickers with a two-digit year resolve to the wrong decade
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Open Common/SymbolRepresentation.cs and read ParseFutureOptionSymbol, following how it builds the expiry year and where it compares against FutureTickerProperties.ExpirationYearShortLength. Compare that branch with ParseFutureSymbol, which already handles two-digit years correctly, and make the option path agree. Verify with the snippet in the issue plus the symbol-representation tests under the Tests/Common project, and confirm ParseTickerFromUserInput for the JSON symbol yields the same underlying.
Written by the indexing model from the issue text.
Description
Expected Behavior
SymbolRepresentation.ParseFutureOptionSymbol("ESZ05 C1200") returns an option on the December 2005 ES future, the same contract that SymbolRepresentation.ParseFutureSymbol("ESZ05") returns. A two-digit year already defines the decade.
Actual Behavior
ParseFutureOptionSymbol adds 20 to every year below 10, including two-digit years, so ESZ05 C1200 returns an option on the December 2025 ES future. ESH09 P800 returns a 2029 future instead of 2009. The same happens for user-friendly JSON symbols such as {"value":"ESZ05 C1200","type":"8"} and for tickers passed to the data downloader, because both go through SymbolRepresentation.ParseTickerFromUserInput.
Potential Solution
Only move single-digit years into the 2020s, using FutureTickerProperties.ExpirationYearShortLength (Common/SymbolRepresentation.cs, ParseFutureOptionSymbol).
Reproducing the Problem
var option = SymbolRepresentation.ParseFutureOptionSymbol("ESZ05 C1200");
var future = SymbolRepresentation.ParseFutureSymbol("ESZ05");
Assert.AreEqual(future, option.Underlying); // fails: the option's underlying expires in December 2025
System Information
Ubuntu x86_64, .NET SDK 10.0.403, master at 22404ea28b8d3f3c9eb74d6ed9f0444426f8e417.
Checklist
- I have completely filled out this template
- I have confirmed that this issue exists on the current
masterbranch - I have confirmed that this is not a duplicate issue by searching issues
- I have provided detailed steps to reproduce the issue
- Dominant language
- C#
- Stars
- 22.4k
- Forks
- 5.4k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 52
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
-
library-request
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
QuantConnect/Lean#10034 ·
Maintainers usually reply within 1 day
-
`LeanData.TryParsePath` fails on an absolute universe file pathPossibly taken @FeiyangP claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
QuantConnect/Lean#10005 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
QuantConnect/Lean#9965 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
QuantConnect/Lean#9953 ·
Maintainers usually reply within 1 day
-
WebullFeeModel charges SPXW options the SPX exchange feeMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
QuantConnect/Lean#9922 · 2 comments ·
Maintainers usually reply within 1 day
All issues in QuantConnect/Lean
Similar issues
-
The Recommended preset turns on Import Uno DSP, which only works with the Material themePossibly taken @agneszitte claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
unoplatform/uno.templates#2388 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
eyalgolan/statecraft-israel#2732 ·
Maintainers usually reply within 1 day
-
要トリアージ
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
kind/chore status/draft
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Altinn/altinn-events#1158 ·
Maintainers usually reply within 1 day
-
S: Untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Trauma-Station/Trauma-Station#5285 ·
Maintainers usually reply within 1 day