AM settlement timestamp is skipped for Wednesday VIX and legacy Saturday SPX expirations

Aperta
#10,117 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

priority:P1
Observed behavior

OptionSymbol.GetSettlementDateTime skips its AM-settlement adjustment for recognized AM-settled contracts when the nominal date is not in the generic third-Friday window, or when it resolves to a different trading date.

Reproduced on master (7939b7878) with the bundled database:

Root / nominal expiry IndexOptionSymbol.IsAMSettled OptionSymbol.IsStandard Returned settlement (America/Chicago)
VIX / 2016-02-17 true false 2016-02-17 15:15
SPX / 2014-06-21 true true 2014-06-20 15:15

Both remain afternoon values rather than the AM settlement time described by the helper's own contract. For the legacy Saturday SPX contract, GetLastDayOfTrading correctly resolves Friday 2014-06-20, but the settlement branch then rejects that date because it differs from the nominal Saturday expiry.

Minimal reproduction:

foreach (var c in new[] {
    ("VIX", new DateTime(2016, 2, 17)),
    ("SPX", new DateTime(2014, 6, 21)) })
{
    var underlying = Symbol.Create(c.Item1, SecurityType.Index, Market.USA);
    var option = Symbol.CreateOption(underlying, c.Item1, Market.USA,
        OptionStyle.European, OptionRight.Call, 200m, c.Item2);
    Console.WriteLine($"{option}: AM={IndexOptionSymbol.IsAMSettled(option)}, standard={OptionSymbol.IsStandard(option)}, settlement={OptionSymbol.GetSettlementDateTime(option):yyyy-MM-dd HH:mm}");
}
Cause and required result

The AM branch in Common/Securities/Option/OptionSymbol.cs requires both IsStandard(symbol) and expiryTime.Date == symbol.ID.Date.Date in addition to the explicit AM-settlement classification. A Wednesday VIX expiry fails the former; the legacy Saturday SPX expiry fails the latter. OptionIndicatorBase.Expiry consequently overstates the remaining time for the Greeks/IV indicators.

Use the contract's AM-settlement classification and appropriate settlement date without requiring every such contract to have a third-Friday nominal expiry. Include Wednesday VIX and pre-2015 Saturday SPX cases alongside the existing SPX tests.

This concerns the timestamp used by indicators, not the exercise-price issue in #7728. It predates #10114, whose change leaves the AM branch untouched.

Lingua principale
C#
Stelle
22.5k
Fork
5.4k
Merge medio
22h 6m
PR unite (30g)
81

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.