Execution models retain detached consolidators after partial universe removal
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Problem
The VWAP and standard-deviation execution models can retain a detached consolidator when a symbol leaves one universe but remains in another universe with a different subscription configuration. The symbol never leaves the algorithm in this case.
Security.Subscriptions retains the removed configuration, including its consolidator, even though that configuration is absent from the subscription service. A later selection by the first universe therefore makes the cached consolidator look attached when it is not receiving data.
This is a pre-existing partial-membership case, distinct from #10007's complete departure/reselection; it also reproduces with the models before #10098.
Reproduction and observations
Use SPY minute data from 2020-02-10 through 2020-04-09 with two scheduled universes:
- Universe A uses regular-hours subscriptions, selects SPY until 2020-02-14, then selects it again from 2020-03-23 onward.
- Universe B always selects SPY, using minute subscriptions with
extended_market_hours=True. - Give the scheduled universes different trigger times, such as 00:00 and 00:01, so they have distinct universe symbols.
- Use the Python VWAP execution model. Open a 10-share position before A deselects SPY. Liquidate it on 2020-02-20 so A's deferred subscription removal can complete while B still holds SPY as a member.
- On A's reselection, give the execution model a
PortfolioTarget(SPY, -10).
Tested end to end. At reselection, the sum of consolidators in security.subscriptions was 1, but the sum in algorithm.subscription_manager.subscription_data_config_service.get_subscription_data_configs(symbol) was 0. The model retained the original SymbolData, and no execution-model sell occurred through 2020-04-09. The same configuration without universe B rebuilds the model and sells on 2020-03-23.
Code path
Engine/DataFeeds/UniverseSelection.cs:674-697removes A's membership and data feed but skipsSecurity.Reset()and security removal because B keeps the security active.Engine/DataFeeds/DataManager.cs:389-407,539-550removes the feed/config from the service, without removing its reference from the security's subscription collection.Common/Securities/Security.cs:79-85returns the retained collection.- On A's reselection,
UniverseSelection.cs:629-633finds a value-equal configuration in that collection and does not replace the old reference. The new live feed uses a different configuration object. - Both execution models and their Python ports retain their cached symbol data. Looking for the cached consolidator only in
Security.Subscriptionsdoes not distinguish this state from a live registration.
Required outcome
When a model's actual feeding subscription has been removed, a subsequent addition must reconnect/rebuild its symbol data even when another universe kept the symbol active. A suggested narrow fix is to base consolidator-liveness checks on the current subscription service configurations, rather than the security's retained collection. If the subscription collection itself is corrected instead, other universes' live configurations must remain intact.
Add regression coverage with overlapping universes and different subscription configurations. Keep the same minute resolution in this reproduction so resolution-selection behavior is not a second variable.
Priority P2: verified wrong execution behavior in a specific multi-universe setup, without evidence of widespread current impact. Evidence of affected live algorithms would raise the priority.
- Lingua principale
- C#
- Stelle
- 22.5k
- Fork
- 5.4k
- Merge medio
- 22h 6m
- PR unite (30g)
- 81
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
-
PDF report generation can overwrite HTML when the destination extension is not lowercase .htmlAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
QuantConnect/Lean#10082 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
QuantConnect/Lean#10059 ·
I maintainer di solito rispondono entro 1 giorno
-
Library Request: highspyApertalibrary-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
QuantConnect/Lean#10034 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
QuantConnect/Lean#9965 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
QuantConnect/Lean#9955 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di QuantConnect/Lean
Issue simili
-
bug emitter:client:csharp
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
microsoft/typespec#12572 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
needs-area-label
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
AWS Lambda: KeyNotFoundException drops HTTP-triggered transactions when allowAllHeaders is disabledApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
newrelic/newrelic-dotnet-agent#3949 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area-networking
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
dotnet/aspnetcore#70545 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 87/100
I maintainer di solito rispondono entro 1 giorno