Live: a split whose factor-file row first arrives after the row's date is never emitted (LiveSplitEventProvider)
I maintainer di solito rispondono entro 1 giorno
@Amadeus-22 ci sta già lavorando.
Dal 30/10/2026.
- #10169 di @quantconnect-kronos — chiusa senza merge
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start with Engine/DataFeeds/Enumerators/LiveSplitEventProvider.cs and SplitEventProvider.cs, then inspect CorporateFactorProvider.HasSplitEventOnNextTradingDay and the corresponding live dividend provider. Model a refreshed factor file that adds a row keyed to an already-processed date, and verify the split or dividend is emitted on the next tradable-date event; the issue also calls for preserving the existing event timing.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Expected behavior
A live algorithm holding a US equity receives the Split (SplitType.SplitOccurred) event, and has its holdings quantity and price adjusted, for every split that the factor files carry before the split's effective session, however late the row reached the factor file relative to its own date.
Actual behavior
LiveSplitEventProvider only looks for a split row keyed to the current tradable date (CorporateFactorProvider.HasSplitEventOnNextTradingDay(eventArgs.Date)). A factor-file row that first appears in a refreshed factor file after the row's date has already passed is never seen, so the split is never emitted and the holdings are never adjusted, even when the split's effective session is still in the future at the time of the refresh.
Observed on a QuantConnect Cloud paper deployment (LEAN 2.5.0.0.18201, started Friday 2026-10-23 13:12 UTC) holding six Nasdaq symbols that all had reverse splits effective at the open of Monday 2026-10-26. Factor-file rows for a split effective on 10-26 are keyed to the previous trading day, 20261023.
- COCH, HCTI, PPCB: the
20261023row was already in the archiveequity/usa/factor_files/factor_files_20261022.zip, which the deployment loaded at start-up on 10-23.HasSplitEventOnNextTradingDay(2026-10-23)matched, theWarningwas emitted on 10-23 andSplitOccurredon the next tradable-date event (10-24 08:00 NY). Holdings were adjusted:
2026-10-24T12:00:13.99 TRACE:: AlgorithmManager.Run(): 10/24/2026 8:00:00 AM: Pre-Split for Split: COCH: 10 | 0.5959. Security Price: 0.5870 Holdings: -15453
2026-10-24T12:00:14.00 TRACE:: AlgorithmManager.Run(): 10/24/2026 8:00:00 AM: Post-Split for Split: COCH: 10 | 0.5959. Security Price: 5.8700 Holdings: -1545
- GCTK, IPW, SBFM: the
20261023row is absent fromfactor_files_20261022.zipand first present infactor_files_20261023.zip(built after the 10-23 session). The deployment's daily refresh loaded that file on 10-24 at 08:00 NY, and the provider logged the new row:
2026-10-24T12:00:13.99 TRACE:: LiveSplitEventProvider(GCTK,#0,GCTK,Minute,TradeBar,Trade,Adjusted,OpenInterest): new tradable date 20261024. New FactorFile: True. FactorFile.Count Old: 6 New: 7
2026-10-24T12:00:13.99 TRACE:: LiveSplitEventProvider(IPW,#0,IPW,Minute,TradeBar,Trade,Adjusted,OpenInterest): new tradable date 20261024. New FactorFile: True. FactorFile.Count Old: 5 New: 6
2026-10-24T12:00:13.99 TRACE:: LiveSplitEventProvider(SBFM,#0,SBFM,Minute,TradeBar,Trade,Adjusted,OpenInterest): new tradable date 20261024. New FactorFile: True. FactorFile.Count Old: 5 New: 6
HasSplitEventOnNextTradingDay(2026-10-24), (2026-10-25) and (2026-10-26) all look for a row keyed to that day; the row is keyed 20261023, so none matches. No Warning, no SplitOccurred, no Pre-Split line for any of the three through the 10-26 open. The deployment still prices the pre-split share counts at post-split prices (GCTK 1-for-2, IPW 1-for-12, SBFM 1-for-20).
Rows in the two archives (date, price factor, split factor, reference price):
gctk.csv factor_files_20261022.zip: ... 20260828,1,15,0.282 / 20501231,1,1,0
gctk.csv factor_files_20261023.zip: ... 20260828,1,30,0.282 / 20261023,1,2,0.4032 / 20501231,1,1,0
coch.csv factor_files_20261022.zip: 20210422,1,10,1 / 20261023,1,10,0.5959 / 20501231,1,1,0
LiveDividendEventProvider has the same structure (DividendEventProvider.GetEvents line 102 calls HasDividendEventOnNextTradingDay(eventArgs.Date)), so a dividend row arriving one refresh late is skipped the same way.
Where
Engine/DataFeeds/Enumerators/LiveSplitEventProvider.cslines 36-54: refreshes the factor file on each new tradable date, logs the row-count change, then defers to the base.Engine/DataFeeds/Enumerators/SplitEventProvider.cslines 72-108: emits a pendingSplitOccurred, then callsHasSplitEventOnNextTradingDay(eventArgs.Date)for the current date only.Common/Data/Auxiliary/CorporateFactorProvider.cslines 147-151:SortedFactorFileData.IndexOfKey(date)is an exact-key lookup.
Proposed change
When the live provider's refresh produces a new factor-file instance, also check the rows keyed to dates between the last tradable date processed and eventArgs.Date (exclusive). If one of them is a split (or dividend) that the previous instance did not carry, treat it as the pending event: emit the Warning now and the SplitOccurred on the next tradable-date event, which is the same timing the engine already uses when the row is present on its own date (COCH above: Warning 10-23, SplitOccurred 10-24). Equivalent for LiveDividendEventProvider. This needs the base providers to expose the pending-event state (currently private _splitFactor / _referencePrice) or a protected hook for the derived live classes.
Reproduce
No cloud backtest reproduces it (the backtest provider reads one factor file for the run); the evidence is the live syslog above and the two dated factor-file archives, both read for this report. A unit test can model it: build a SplitEventProvider over a factor file without the 20261023 row, call GetEvents for 2026-10-23, swap the provider's factor file for one with the row, call GetEvents for 2026-10-24, 10-25 and 10-26, and assert that a Split is emitted; today none is.
Intercom conversation 215476559937869.
- Lingua principale
- C#
- Stelle
- 22.6k
- Fork
- 5.4k
- Merge medio
- 11h 39m
- PR unite (30g)
- 104
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di QuantConnect/Lean
-
priority:p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
QuantConnect/Lean#10216 ·
I maintainer di solito rispondono entro 1 giorno
-
priority:p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
QuantConnect/Lean#10206 ·
I maintainer di solito rispondono entro 1 giorno
-
priority:p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
QuantConnect/Lean#10199 ·
I maintainer di solito rispondono entro 1 giorno
-
priority:p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
QuantConnect/Lean#10198 ·
I maintainer di solito rispondono entro 1 giorno
-
priority:p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
QuantConnect/Lean#10197 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di QuantConnect/Lean
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
dotnet-outdated/dotnet-outdated#871 ·
I maintainer di solito rispondono entro 1 giorno
-
triage/untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
unoplatform/uno#26676 ·
I maintainer di solito rispondono entro 1 giorno
-
.NET bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
[问题] 导出文件时,提示后面还有1243390911步Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
jhaizhou-ops/S2Arm#2177 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
area-CodeGen-coreclr untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
dotnet/runtime#138181 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno