RelativeDailyVolume merges sparse sessions sharing a day-of-month
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
阅读 Indicators/RelativeDailyVolume.cs 第 85–104 行附近的代码,找到使用 input.Time.Day 的会话变更比较逻辑。然后找到现有的 RelativeDailyVolume 测试,并添加一个回归用例:先准备好指标,再在日历日期不同但月份中的日期相同的情况下进行稀疏更新。后续更新导致会话切换且报告的比率为 0.5 时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Problem
RelativeDailyVolume detects a session change by comparing only input.Time.Day. If sparse updates skip to the same day-of-month in a later month, it treats the new session as the old one, keeps the old volume in the numerator and fails to advance its historical state.
Source: Indicators/RelativeDailyVolume.cs, lines 85–104.
Reproduction
using System;
using QuantConnect;
using QuantConnect.Data.Market;
using QuantConnect.Indicators;
var symbol = new Symbol(SecurityIdentifier.GenerateEquity("SPY", Market.USA, false), "SPY");
TradeBar Bar(DateTime time, decimal volume) =>
new TradeBar(time, symbol, 9, 10, 9, 10, volume, TimeSpan.FromMinutes(1));
var rdv = new RelativeDailyVolume(1);
rdv.Update(Bar(new DateTime(2024, 1, 14, 9, 30, 0), 100));
rdv.Update(Bar(new DateTime(2024, 1, 15, 9, 30, 0), 100));
rdv.Update(Bar(new DateTime(2024, 2, 15, 9, 30, 0), 50));
Console.WriteLine($"{rdv.IsReady}: {rdv.Current.Value}");
Executed result: True: 1.5. Expected: True: 0.5.
The January 15 update makes the period-1 indicator ready. February 15 has the same .Day value, so January's volume 100 remains in _currentData; the ratio becomes (100 + 50) / 100 instead of 50 / 100.
Required result
Distinct calendar dates must trigger session rollover even when their day-of-month values match. Add a regression test with an already-ready indicator and sparse updates across a month-long gap. This does not ask to invent data for dates with no updates.
Priority is low: the demonstrated case needs a long gap in input, rather than ordinary consecutive-session updates.
- 主要语言
- C#
- 星标
- 22.6k
- 派生
- 5.4k
- 平均合并
- 11 小时 39 分钟
- 30 天内合并 PR
- 104
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
QuantConnect/Lean 的其他 Issue
-
priority:p2
难度 2/5 1-3 小时 新手友好度 72/100
QuantConnect/Lean#10216 ·
维护者通常 1 天内回复
-
priority:p2
难度 2/5 1-3 小时 新手友好度 78/100
QuantConnect/Lean#10206 ·
维护者通常 1 天内回复
-
priority:p2
难度 2/5 1-3 小时 新手友好度 76/100
QuantConnect/Lean#10198 ·
维护者通常 1 天内回复
-
priority:p2
难度 2/5 1-3 小时 新手友好度 78/100
QuantConnect/Lean#10197 ·
维护者通常 1 天内回复
-
priority:p2
难度 2/5 1-3 小时 新手友好度 82/100
QuantConnect/Lean#10191 · 1 条评论 ·
维护者通常 1 天内回复
查看 QuantConnect/Lean 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
dotnet-outdated/dotnet-outdated#871 ·
维护者通常 1 天内回复
-
triage/untriaged
难度 2/5 1-3 小时 新手友好度 78/100
unoplatform/uno#26676 ·
维护者通常 1 天内回复
-
.NET bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
jhaizhou-ops/S2Arm#2177 · 3 条评论 ·
维护者通常 1 天内回复
-
area-CodeGen-coreclr untriaged
难度 2/5 1-3 小时 新手友好度 65/100
dotnet/runtime#138181 · 1 条评论 ·
维护者通常 1 天内回复