Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Market On Open isn't accurate

オープン
#9,503 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
csharp
領域
backend

調査の方向性

EquityFillModel.cs から始め、特にレポートで取り上げられている Tick と TradeBar の分岐を確認し、market-on-open 注文を含む分足データのバックテストで動作を再現してください。キャッシュされた TradeBar と公式の始値がどのように選択されるかを確認し、fill が期待される日次の始値を使用し、報告されたタイミングが修正されるように、対象を絞ったテストを追加または更新してください。

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

説明

Expected Behavior

Market on open should mimic the official open price for the day when subscribing to regular data feed (such as minute) as outlined here
https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/market-on-open-orders

Actual Behavior

this backtest isnt actually producing any results as described in the article.
as well i have noticed on other backtests that when subscribing to minute data the qc takes the 2nd bar after the open (the bar of 09:32 and not and not 09:31 as outlined in your article... )

Potential Solution

might be related to this:

For MOO, official opening price is only used in the Tick branch: EquityFillModel.cs (line 458) looks for OfficialOpen | OpeningPrints.
But our algo subscribes to minute TradeBars, so LEAN uses this branch instead: EquityFillModel.cs (line 503). That branch literally does:

_var tradeBar = asset.Cache.GetData<TradeBar>();
fill.FillPrice = tradeBar.Open;_

at line 505 (line 505) and line 518 (line 518).
So yes: with minute bars, QC MOO can fill from the cached minute bar Open, not the official daily open. If the cached bar is the 09:31-09:32 bar, the report shows 09:32 and price matches 09:31 open.

Reproducing the Problem

create a backtest with subscribing to minute data and do some MOO, see that trade prices are not the daily open prices.

System Information

QC CLoud

Checklist
  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
主要言語
C#
スター
21.9k
フォーク
5.3k
平均マージ
19時間 31分
マージ済み PR(30日)
44

環境構築

Codespaces で開く

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

はじめの一歩

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

QuantConnect/Lean のほかの issue

QuantConnect/Lean の issue をすべて見る

似ている issue

C# の issue をもっと見る

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

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