Conversation
- copy FaGroup, FaMethod, FaPercentage, Account and OutsideRth from the ib open order - pass the properties to every rebuilt order type - share the percent change method check with the order placement - add a live test with a limit order and a combo limit order
Romazes
force-pushed
the
bug-rebuilt-open-orders-lose-ib-properties
branch
from
September 29, 2026 18:03
1ac6006 to
26635c1
Compare
Martin-Molinero
approved these changes
Oct 1, 2026
- wrap ConvertOrderProperties in a try catch and log the error - log the order values the conversion reads - return null so the rebuilt order gets the default order properties
Romazes
force-pushed
the
bug-rebuilt-open-orders-lose-ib-properties
branch
from
October 1, 2026 15:24
cbbd626 to
f407dca
Compare
Martin-Molinero
approved these changes
Oct 1, 2026
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
Open orders that the brokerage rebuilds in
GetOpenOrdersnow carryInteractiveBrokersOrderProperties. Before, a rebuilt order had plainOrderProperties.OutsideRthOutsideRegularTradingHours, alwaysFaGroupis setFaGroup,FaMethod, andFaPercentagewhen the method isPctChangeFaGroup,Accountis not the account of the deploymentAccountFaProfilecan not be copied, IB has no such field: "openOrder callback will report Profile in place of Group if order was for profile" (IB docs). Such an order is rebuilt with the name inFaGroup.PctChangeis one helper now, used by the order placement too. It does not look at the case of the name; before, the placement compared with== "PctChange".OrderProperties, like before this change.Related PR(s)
CreateRecoveredOrderPropertiesthere, where it works only with the unified groups setting. Here it works for every account.ConvertOrdersmethod. The one merged second may need a rebase.Related Issue
N/A
Motivation and Context
CanEmitFillaccepted every execution of a rebuilt order, the ones of the allocations too. Now a rebuilt account group order reports only the execution of the master account, and a single managed account order only the executions of that account.The update of a rebuilt order is not a reason: master sends it with
OutsideRth = falseand the master account, but IB keeps the flag and the routing of the open order (second table below).Requires Documentation Change
No
How Has This Been Tested?
Live on the IB paper Financial Advisor account (group filter
TEST), 2026-09-29, regular trading hours.InteractiveBrokersOpenOrderPropertiesTests.GetOpenOrdersAfterRestartKeepsOutsideRegularTradingHoursplaces the order with the flag, stops the brokerage, starts a new one and readsGetOpenOrders:25fa44026635c1(Limit, 100), SPY(ComboLimit, 0.05), SPXW 7700/7750 call spread, 2026-10-02Both fail with
Expected: instance of <QuantConnect.Orders.InteractiveBrokersOrderProperties> But was: <QuantConnect.Orders.OrderProperties>.An update that carries other values than the open order has. IB takes the new price only, with no error and no warning:
OutsideRth = true, single managed account, no groupOutsideRth = false, master account,FaGroup = "TEST"OutsideRth = true, the same managed account, no groupOutsideRth = trueOutsideRth = falseOutsideRth = trueOutsideRth = falseOutsideRth = trueOutsideRth = false2109 - Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.InteractiveBrokersOpenOrderTimeConversionTestsandInteractiveBrokersFaGroupOrderConversionTestspass.PctChange. The follow-up commitf407dca(try catch and log around the conversion) was built, not run live.Types of changes
Checklist:
bug-<issue#>-<description>orfeature-<issue#>-<description>