AlgoSeekFuturesProcessor duplicates the last tick on final flush
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
Start with ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesProcessor.cs, especially the tick resolution setup near line 133 and FlushBuffer near lines 211–213. Trace how IdentityDataConsolidator<Tick> writes each tick and how final flush handles WorkingData. Done means the reproduction writes one row per input tick at tick resolution while final flush still writes unfinished bars at aggregated resolutions.
Written by the indexing model from the issue text.
Description
Problem
ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesProcessor.cs writes the last tick of each contract and tick type twice when converting at tick resolution.
At Resolution.Tick the processor uses IdentityDataConsolidator<Tick> (line 133). Its Update raises DataConsolidated for every tick, which writes the line, and also keeps the tick as WorkingData. FlushBuffer(frontier, finalFlush: true) then writes WorkingData again (lines 211-213), so the file ends with a duplicate of its last row.
Reproduction
var date = new DateTime(2020, 4, 22);
var symbol = Symbol.CreateFuture("CL", Market.NYMEX, new DateTime(2020, 5, 19));
var processor = new AlgoSeekFuturesProcessor(symbol, date, TickType.Trade, Resolution.Tick, outputDirectory);
processor.Process(new Tick { Symbol = symbol, Time = date.AddHours(10), TickType = TickType.Trade, Value = 20m, Quantity = 1 });
processor.FlushBuffer(DateTime.MaxValue, true);
// the generated tick file holds 2 identical rows instead of 1
What a fix must achieve
Each input tick is written once at tick resolution, including the last one, while the final flush still writes the unfinished bar at aggregated resolutions. Suggestion only: skip the WorkingData write when the resolution is Tick.
- 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 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
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