Inherited index early closes retain Chicago wall time in New York exchange calendars

Aperta
#10,115 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

On master (7939b7878), the NDXP and NQX entries use America/New_York, but GetLastDailyMarketClose returns 12:00 Eastern on 2025-11-28. They inherit the wildcard index calendar's 12:00 America/Chicago early close without converting it into their exchange timezone. The inherited instant should be 13:00 Eastern.

Minimal reproduction, using the bundled market-hours database:

var expiry = new DateTime(2025, 11, 28);
var underlying = Symbol.Create("NDX", SecurityType.Index, Market.USA);
foreach (var ticker in new[] { "NDXP", "NQX" })
{
    var option = Symbol.CreateOption(underlying, ticker, Market.USA,
        OptionStyle.European, OptionRight.Call, 200m, expiry);
    var hours = MarketHoursDatabase.FromDataFolder()
        .GetExchangeHours(Market.USA, option, SecurityType.IndexOption);
    Console.WriteLine($"{ticker}: {hours.TimeZone}, {hours.GetLastDailyMarketClose(expiry, false):yyyy-MM-dd HH:mm}");
}

Observed for both: America/New_York, 2025-11-28 12:00.

Cause and impact

Common/Util/MarketHoursDatabaseJsonConverter.cs copies underlyingEntry.ExchangeHours.EarlyCloses directly at lines 307–309 and merges market-wide early closes at lines 338–340. The result is then constructed in the target ExchangeTimeZone at line 349. The NDX underlying itself inherits the wildcard Chicago index calendar, so the error also exists before the option entry inherits from NDX.

The affected calendar can mark the exchange closed an hour too early. A settlement helper that correctly preserves this calendar value still cannot establish the real exchange closing instant.

Required result

Inherited early closes must retain their intended instant when source and target exchange timezones differ, with tests covering NDX/NDXP/NQX and unchanged Chicago SPX/SPXW behavior. Review late-open inheritance for the same timezone assumption. A suggestion is to make the inheritance timezone-aware in the shared conversion path, rather than special-casing callers.

This calendar defect is present before #10114; that change's database-preservation guard does not introduce it.

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.