Fix: Get GroupOrders ByBrokerageId #8310
Merged
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
This Pull Request addresses a bug in the ComboOrders retrieval process. Previously, when fetching all ComboOrders, the system would only return legs that were not fully filled, omitting those that had already been filled. This caused incomplete ComboOrders to be returned, which is incorrect behavior.
For example, if a ComboMarket Order had 3 legs:
Leg 1:
OrderStatus.Filled
Leg 2:
OrderStatus.PartiallyFilled
Leg 3:
OrderStatus.PartiallyFilled
With the bug, only legs 2 and 3 would be returned, excluding the already filled leg 1, which is not the expected outcome.
Related Issue
N/A
Related PRs
PlaceOrder()
(ComboMarket
&&ComboLimit
) Lean.Brokerages.TradeStation#24Motivation and Context
It's crucial to understand that if only a part of the ComboOrder legs is returned, it can result in an inaccurate data representation, particularly when users require the full status of all legs. This update guarantees that all legs, irrespective of their fill status, are returned. This will provide a more accurate and comprehensive view of the ComboOrders.
Requires Documentation Change
N/A
How Has This Been Tested?
OrderProvider.GetOrdersByBrokerageId(...)
in brokerage and inspect result.Types of changes
Checklist:
bug-<issue#>-<description>
orfeature-<issue#>-<description>