IndicatorHistory can feed quote bars where the live indicator gets trade bars
Maintainer thường phản hồi trong vòng 1 ngày
@quantconnect-kronos đang làm issue này rồi.
Từ ngày 18/11/2026.
- #10205 của @quantconnect-kronos — đang mở
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 50/100
Hướng nghiên cứu
Start in Algorithm/QCAlgorithm.Indicators.cs at the IndicatorHistory overload that takes a dataType of null, then follow it into Common/Data/SliceExtensions.cs (PushThrough). Compare with how RegisterIndicator picks the data type it consolidates, and with Slice.CreateDynamicDataDictionary and SymbolData.GetData(). Done when the reproduction slices (trade close 100+i, quote close 200+i) feed the indicator trade bars, so the history matches the live values.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
IndicatorHistory can update an indicator with quote bars where the same indicator, registered for live updates, gets trade bars. Its values then differ from the live ones for the same period.
When no data type is given (dataType == null), IndicatorHistory pushes each slice through SliceExtensions.PushThrough, which hands the indicator slice[symbol]. A slice's value for a symbol is the type of the last default-type datum added for it (Slice.CreateDynamicDataDictionary, SymbolData.GetData()). For a security with both trade and quote data, such as a future, that can be a QuoteBar. Meanwhile RegisterIndicator consolidates trade bars for the same subscription.
Reproduction
A slice holding a TradeBar (close 100) and a QuoteBar (close 200) for one future symbol, three hours in a row:
var algorithm = new AlgorithmStub();
var symbol = Symbol.CreateFuture("ES", Market.CME, new DateTime(2024, 3, 15));
var slices = Enumerable.Range(0, 3).Select(i =>
{
var time = new DateTime(2024, 1, 2, 10 + i, 0, 0);
var trade = new TradeBar(time, symbol, 100 + i, 100 + i, 100 + i, 100 + i, 10, TimeSpan.FromHours(1));
var quote = new QuoteBar(time, symbol, new Bar(200 + i, 200 + i, 200 + i, 200 + i), 1,
new Bar(200 + i, 200 + i, 200 + i, 200 + i), 1, TimeSpan.FromHours(1));
return new Slice(time.AddHours(1), new List<BaseData> { trade, quote }, time.AddHours(1));
}).ToList();
var rows = algorithm.IndicatorHistory(new SimpleMovingAverage(1), slices).Current;
// rows: 200, 201, 202 (the quote closes); an indicator taking IBaseData receives the QuoteBar objects
With real data, the history of an indicator over hourly continuous futures (ES, GC, CL) in January 2024 had a few rows computed from quote closes. At 2024-01-02 16:00 New York, ES's 1-hour rate of change in the history was 5331.950 / 5311.905 − 1 (quote closes), while the live indicator got 5332.089 / 5311.765 − 1 (trade closes). The live values and a replay of the same history's trade bars agree with each other.
Where
QCAlgorithm.IndicatorHistory(IndicatorBase<T>, IEnumerable<Slice>, Action<IBaseData>, Type),Algorithm/QCAlgorithm.Indicators.csSliceExtensions.PushThrough(IEnumerable<Slice>, Action<BaseData>, Type),Common/Data/SliceExtensions.cs
What a fix must achieve
IndicatorHistory updates an indicator with the same data type that RegisterIndicator would consolidate for it, so history and live values agree. A suggestion only: resolve the data type from the subscription when the selector doesn't imply one.
- Ngôn ngữ chính
- C#
- Star
- 22.6k
- Fork
- 5.4k
- Merge trung bình
- 11 giờ 39 phút
- Pull request đã merge (30 ngày)
- 104
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
-
priority:p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
QuantConnect/Lean#10216 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
priority:p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
QuantConnect/Lean#10206 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
priority:p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
QuantConnect/Lean#10199 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
priority:p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
QuantConnect/Lean#10198 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
priority:p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
QuantConnect/Lean#10197 ·
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ự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
dotnet-outdated/dotnet-outdated#871 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage/untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
unoplatform/uno#26676 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
.NET bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[问题] 导出文件时,提示后面还有1243390911步Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
jhaizhou-ops/S2Arm#2177 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area-CodeGen-coreclr untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
dotnet/runtime#138181 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày