Repository navigation
Add contingent orders support: order groups and order sends order - #109
Merged
Merged
Conversation
Places OCO/BRK order groups through the order groups endpoint and the orders triggered by another as OSOs, reports triggered orders once their parent fills and rebuilds the contingencies of open orders from their linked orders. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
5 of 11 tasks
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…TradeStation TradeStation confirms the orders sent by another (OSO) before it: the placed orders are matched in that order, ruling out the confirmations which are for another side or order type. Orders canceled by TradeStation (CAN), like the orders sent by a canceled order, are reported as canceled. Canceling a member of an order group warns once that the rest keep working. The contingent orders tests cover equities, options, index options and futures. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…rders test Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
3 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Places contingent order sets through TradeStation's native order relationships:
OrderContingency.Trigger/Relate.CAN), like the orders sent by a canceled order, are reported as canceled.OPN) are loaded as open orders, they were skipped.Related Issue
Requires QuantConnect/Lean#9828, which adds contingent orders to Lean. This PR builds against it, so CI will pass once it's merged and released.
Motivation and Context
Support for Lean contingent orders (OCO, OTO, OUO, brackets) using the brokerage's native functionality, so the sets are placed atomically and managed on the brokerage side.
Requires Documentation Change
The supported contingent order shapes of this brokerage, see its brokerage model in Lean.
How Has This Been Tested?
BrokerageTestscontingent orders suite (TradeStationBrokerageTests.ContingentOrders.cs):CancelOrdersfails as on master: the second cancel of the closed order returns true (_cancelOrderSoftRejects).Types of changes
Checklist:
bug-<issue#>-<description>orfeature-<issue#>-<description>🤖 Generated with Claude Code