Daily-resolution market orders converted to MarketOnClose are rejected by brokerage models without MarketOnClose
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- csharp
- Lĩnh vực
- backend, fintech-quant
Hướng nghiên cứu
Start with QCAlgorithm.ConvertMarketOrderIfRequired and the brokerage models' CanSubmitOrder supported order types, especially Tradier, Tastytrade, Public, and Webull. Run the supplied daily-resolution SPY reproduction with Tradier and inspect the order type and status. Done means converted orders are accepted and fill at the close when the original market order is supported.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Expected Behavior
In a backtest, a market order placed during market hours on an equity subscribed only at daily resolution is converted to MarketOnClose (or MarketOnOpen within the MOC buffer) by QCAlgorithm.ConvertMarketOrderIfRequired (#9534). The converted order should be accepted by the brokerage model whenever the original market order would have been, and fill at the close.
Actual Behavior
Brokerage models whose supported order types include Market but not MarketOnClose reject the converted order, so every such market order comes back Invalid:
BrokerageModel declared unable to submit order: [1] Warning - Code: NotSupported - The TradierBrokerageModel does not support MarketOnClose order type. Only supports [Limit,Market,StopMarket,StopLimit]
The user called MarketOrder, which the model supports, and the order never fills. Live trading does not convert, so the same algorithm behaves differently live and in backtest.
Models with the same supported-type pattern (from reading their CanSubmitOrder sets): TradierBrokerageModel (reproduced below), TastytradeBrokerageModel, PublicBrokerageModel, WebullBrokerageModel.
Potential Solution
A suggestion; whoever fixes it picks the approach: let a model accept a MarketOnClose/MarketOnOpen order that Lean created from a market order as a backtest execution proxy, or skip the conversion when the brokerage model doesn't support the target type.
Reproducing the Problem
public class DailyMarketOrderMocRepro : QCAlgorithm
{
private Symbol _spy;
public override void Initialize()
{
SetStartDate(2013, 10, 7);
SetEndDate(2013, 10, 11);
SetCash(100000);
SetBrokerageModel(BrokerageName.TradierBrokerage);
_spy = AddEquity("SPY", Resolution.Daily).Symbol;
Schedule.On(DateRules.EveryDay(_spy), TimeRules.AfterMarketOpen(_spy, 30), () =>
{
var ticket = MarketOrder(_spy, 1);
Log($"{Time} type={ticket.OrderType} status={ticket.Status}");
});
}
}
Output on master: every day logs type=MarketOnClose status=Invalid with the message above.
System Information
master (06eb5cb31)
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
- Ngôn ngữ chính
- C#
- Star
- 22.4k
- Fork
- 5.4k
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 63
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của QuantConnect/Lean
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
QuantConnect/Lean#10059 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Library Request: highspyĐang mởlibrary-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
QuantConnect/Lean#10034 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`LeanData.TryParsePath` fails on an absolute universe file pathCó thể đã có người làm @FeiyangP đã nhận 8 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
QuantConnect/Lean#10005 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
QuantConnect/Lean#9965 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
QuantConnect/Lean#9955 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của QuantConnect/Lean
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
RadicalCSG/com.chisel#312 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
DeveloperAcademy-POSTECH/2026-C6-M10-MUSA#677 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
REQ-13 : une demande En cours perd son responsable par un simple enregistrement, et reste En coursĐang mởa-corriger bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
christian-raj/S-Aloha#301 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
.NET Docs Next Major State: Needs Discussion
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
getsentry/sentry-dotnet#5912 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày