AlgoSeekFuturesProcessor duplicates the last tick on final flush

オープン 初心者向け
#10,147 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp
領域
data

調査の方向性

ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesProcessor.csから始め、特に133行目付近のティック解像度の設定と、211~213行目付近のFlushBufferを確認してください。IdentityDataConsolidator<Tick>が各ティックを書き込む方法と、最終フラッシュがWorkingDataを処理する方法を追ってください。再現コードがティック解像度で入力ティックごとに1行を書き込み、最終フラッシュでは集約解像度の未完了バーも引き続き書き込めれば完了です。

索引モデルが issue の本文から書いたものです。

説明

priority:p2

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.

主要言語
C#
スター
22.5k
フォーク
5.4k
平均マージ
13時間 11分
マージ済み PR(30日)
104

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

QuantConnect/Lean のほかの issue

QuantConnect/Lean の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。