TradeStationBrokerageModel refuses combo order quantity updates that TradeStation supports
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- csharp
- Domain
- fintech-quant
Research direction
Start at TradeStationBrokerageModel.CanUpdateOrder and reproduce the issue with SetBrokerageModel(BrokerageName.TradeStation), a ComboLimitOrder, and UpdateOrderFields { Quantity = 2 }. Compare the backtest result with the described TradeStation simulation behavior; done means combo quantity updates are accepted in the backtest and both legs resize from 1 to 2.
Written by the indexing model from the issue text.
Description
Expected Behavior
TradeStationBrokerageModel.CanUpdateOrder allows updating the quantity of a combo order, which TradeStation supports: the replace quantity resizes the whole spread.
Actual Behavior
It refuses it with NotSupported - Order type 'ComboLimit' is not supported to update quantity in the TradeStationBrokerageModel.. Live trading skips the brokerage model on updates, so after QuantConnect/Lean.Brokerages.TradeStation#107 live resizes the combo while a backtest refuses it.
Same algorithm, ComboLimitOrder AAPL call vertical x1, then tickets[0].Update(new UpdateOrderFields { Quantity = 2 }):
- Live (TradeStation sim, order 972926320):
UpdateSubmittedon both legs; the broker holds Buy 2 / Sell 2. - Backtest: refused by the brokerage model; legs stay 1 / -1.
Potential Solution
Remove the combo quantity check from TradeStationBrokerageModel.CanUpdateOrder.
Reproducing the Problem
Backtest with SetBrokerageModel(BrokerageName.TradeStation), place a ComboLimitOrder and update one leg's quantity.
System Information
Lean master.
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
- Dominant language
- C#
- Stars
- 21.7k
- Forks
- 5.3k
- Avg merge
- 22h 25m
- Merged PRs (30d)
- 37
Getting set up
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
-
library-request
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
QuantConnect/Lean#9743 ·
Maintainers usually reply within 1 day
-
library-request
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
QuantConnect/Lean#9500 ·
Maintainers usually reply within 1 day
-
Library Upgrade: dglOpenlibrary-request
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
QuantConnect/Lean#9499 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
QuantConnect/Lean#9841 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 76/100
QuantConnect/Lean#9838 ·
Maintainers usually reply within 1 day
All issues in QuantConnect/Lean
Similar issues
-
go 🏃 testing 🧪
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
valkey-io/valkey-glide#7239 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15462 ·
Maintainers usually reply within 1 day
-
:watch: Not Triaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
comp:instrumentation.aspnetcore
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-dotnet-contrib#5427 ·
Maintainers usually reply within 1 day
-
enhancement needs-triage pkg:OpenTelemetry
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
open-telemetry/opentelemetry-dotnet#7851 · 4 comments ·
Maintainers usually reply within 1 day