Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Future option tickers with a two-digit year resolve to the wrong decade

Aperta Adatta ai principianti
#9,955 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend

Direzione di ricerca

Apri Common/SymbolRepresentation.cs e leggi ParseFutureOptionSymbol, seguendo come costruisce l'anno di scadenza e dove confronta con FutureTickerProperties.ExpirationYearShortLength. Confronta quel ramo con ParseFutureSymbol, che gestisce già correttamente gli anni a due cifre, e fai in modo che il percorso delle opzioni sia coerente. Verifica con lo snippet nell'issue e con i test di rappresentazione dei simboli nel progetto Tests/Common, e conferma che ParseTickerFromUserInput per il simbolo JSON restituisca lo stesso sottostante.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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 master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
Lingua principale
C#
Stelle
22.3k
Fork
5.4k
Merge medio
1g 11h
PR unite (30g)
58

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di QuantConnect/Lean

Tutte le issue di QuantConnect/Lean

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.