RelativeDailyVolume merges sparse sessions sharing a day-of-month

Aperta Adatta ai principianti
#10,199 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
data

Direzione di ricerca

Leggi Indicators/RelativeDailyVolume.cs intorno alle righe 85–104 e individua il confronto del cambio di sessione che usa input.Time.Day. Poi trova i test esistenti di RelativeDailyVolume e aggiungi un caso di regressione che prepari l’indicatore prima di aggiornamenti diradati in date di calendario distinte con lo stesso giorno del mese. Il lavoro è completato quando l’aggiornamento successivo fa avanzare la sessione e il rapporto riportato è 0.5.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

priority:p2

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.

Lingua principale
C#
Stelle
22.6k
Fork
5.4k
Merge medio
11h 39m
PR unite (30g)
104

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di QuantConnect/Lean

Tutte le issue di QuantConnect/Lean

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.