Execution models retain detached consolidators after partial universe removal
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- C#
- Star
- 22.5k
- Fork
- 5.4k
- Merge trung bình
- 22 giờ 6 phút
- Pull request đã merge (30 ngày)
- 81
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của QuantConnect/Lean
-
PDF report generation can overwrite HTML when the destination extension is not lowercase .htmlĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
QuantConnect/Lean#10082 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
QuantConnect/Lean#10059 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Library Request: highspyĐang mởlibrary-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
QuantConnect/Lean#10034 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
QuantConnect/Lean#9965 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
QuantConnect/Lean#9955 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của QuantConnect/Lean
Issue tương tự
-
bug emitter:client:csharp
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
microsoft/typespec#12572 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-area-label
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
AWS Lambda: KeyNotFoundException drops HTTP-triggered transactions when allowAllHeaders is disabledĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
newrelic/newrelic-dotnet-agent#3949 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area-networking
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dotnet/aspnetcore#70545 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
Maintainer thường phản hồi trong vòng 1 ngày