RelativeDailyVolume returns zero after the final historical time slot
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Read Indicators/RelativeDailyVolume.cs around lines 111–138 and trace how it selects the historical cumulative volume for a requested time. Find the existing RelativeDailyVolume tests and add a case where the current time is after the final historical slot; verify the result uses the latest available cumulative volume and preserves the interior-gap behavior covered by #9629.
Written by the indexing model from the issue text.
Description
Problem
When the current time-of-day is later than every historical time slot, RelativeDailyVolume leaves its fallback denominator at zero and returns zero despite having a nonzero historical cumulative volume.
Source: Indicators/RelativeDailyVolume.cs, lines 111–138.
This is a boundary case distinct from #9629: the existing break fixes selection between historical slots, but no loop iteration assigns a denominator after the final slot. A historical early close followed by a longer trading session can reach this path.
Reproduction
using System;
using QuantConnect;
using QuantConnect.Data.Market;
using QuantConnect.Indicators;
var symbol = new Symbol(SecurityIdentifier.GenerateEquity("SPY", Market.USA, false), "SPY");
var start = new DateTime(2024, 1, 2, 9, 30, 0);
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(start, 100));
rdv.Update(Bar(start.AddMinutes(1), 100));
rdv.Update(Bar(start.AddDays(1).AddMinutes(2), 50));
Console.WriteLine($"{rdv.IsReady}: {rdv.Current.Value}");
Executed result: True: 0. Expected: True: 0.25.
The completed historical day has cumulative volumes 100 at 09:30 and 200 at 09:31. At 09:32, the latest historical cumulative volume is still 200, so the ratio is 50 / 200 = 0.25. No historical key is greater than 09:32, and the fallback never assigns that value.
Required result
Use the most recent available historical cumulative volume when the requested time is after the final historical slot. Add a regression test for this boundary without changing the interior-gap behavior covered by #9629.
Priority is low pending evidence of broader impact; this is limited to unmatched times beyond the historical range.
- 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 85/100
QuantConnect/Lean#10199 ·
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