Market On Open isn't accurate
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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
masterbranch - 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
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
QuantConnect/Lean のほかの issue
-
AlpacaBrokerageModel refuses extended-hours limit orders with the GTC time in force, which Alpaca accepts対応中かも @AlexCatarino が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
QuantConnect/Lean#9892 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
QuantConnect/Lean#9889 ·
メンテナーはふだん 1 日以内に返信
-
library-request
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
QuantConnect/Lean#9879 ·
メンテナーはふだん 1 日以内に返信
-
library-request
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
QuantConnect/Lean#9743 ·
メンテナーはふだん 1 日以内に返信
-
library-request
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
QuantConnect/Lean#9500 ·
メンテナーはふだん 1 日以内に返信
QuantConnect/Lean の issue をすべて見る
似ている issue
-
area-signalr
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
dotnet/aspnetcore#69842 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 2 日以内に返信
-
bug needs-triage
難易度 2/5 1時間未満 初心者へのやさしさ 78/100
microsoft/microsoft-ui-reactor#1373 ·
メンテナーはふだん 1 日以内に返信
-
Client customer-reported KeyVault needs-team-attention question Service Attention
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Azure/azure-sdk-for-net#63861 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
:watch: Not Triaged dotnet-csharp/svc fundamentals/subsvc
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信