RelativeDailyVolume merges sparse sessions sharing a day-of-month
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
Read Indicators/RelativeDailyVolume.cs around lines 85–104 and find the session-change comparison that uses input.Time.Day. Then locate the existing RelativeDailyVolume tests and add a regression case that readies the indicator before sparse updates on distinct calendar dates with the same day-of-month. Done when the later update rolls the session over and the reported ratio is 0.5.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- C#
- Stars
- 22.6k
- Forks
- 5.4k
- Avg merge
- 11h 39m
- Merged PRs (30d)
- 104
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QuantConnect/Lean
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
QuantConnect/Lean#10216 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
QuantConnect/Lean#10206 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
QuantConnect/Lean#10198 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
QuantConnect/Lean#10197 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
QuantConnect/Lean#10191 · 1 comment ·
Maintainers usually reply within 1 day
All issues in QuantConnect/Lean
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
dotnet-outdated/dotnet-outdated#871 ·
Maintainers usually reply within 1 day
-
triage/untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
unoplatform/uno#26676 ·
Maintainers usually reply within 1 day
-
.NET bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
jhaizhou-ops/S2Arm#2177 · 3 comments ·
Maintainers usually reply within 1 day
-
area-CodeGen-coreclr untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dotnet/runtime#138181 · 1 comment ·
Maintainers usually reply within 1 day