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):
UpdateSubmitted on 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
Expected Behavior
TradeStationBrokerageModel.CanUpdateOrderallows 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,
ComboLimitOrderAAPL call vertical x1, thentickets[0].Update(new UpdateOrderFields { Quantity = 2 }):UpdateSubmittedon both legs; the broker holds Buy 2 / Sell 2.Potential Solution
Remove the combo quantity check from
TradeStationBrokerageModel.CanUpdateOrder.Reproducing the Problem
Backtest with
SetBrokerageModel(BrokerageName.TradeStation), place aComboLimitOrderand update one leg's quantity.System Information
Lean master.
Checklist
masterbranch