overFilledOrder StackHandler Error: Can't fill order with fill [-4] more than trade quantity [-3] #1505
Unanswered
adnan-trader
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@bug-or-feature : I have elaborated on: "here are the steps to make it less painful:" as it was still pretty painful!
Ref: [https://github.com//issues/1474]
Scenario: Stackhandler crashes: Trade qty expected -3, but filled -4 trades resulting in overFilledOrder error in stackhandler.
Solution: Manually delete the orders for an instrument, including parent and children?
In general, this is the type of documentation I would add to the manual for common errors encountered in production.
I have written out the steps so that others can follow/edit.
Is this how to ensure you delete the orders for the offending instrument, including parent and children?
For example:
e.g., WARNING stack_handler {'component': 'mongoContractOrderStackData', 'strategy_name': 'trend_100', 'instrument_code': 'NASDAQ_micro', 'contract_order_id': 93, 'instrument_order_id': 97} Can't fill order with fill [-4] more than trade quantity [-3]
(Order ID:97) Type best for breakout_100 NASDAQ_micro, qty [-3], fill [-3]@ price, 19720.25 Parent:no parent Children:[93]
(Order ID:93) Type best for breakout_100/NASDAQ_micro/20250600, qty [-3], fill [-3]@ price, 19720.25 Parent:97 Children:[306, 308, 310, 312, 314]
(Order ID:306) Type limit for breakout_100/NASDAQ_micro/20250600, qty [-1], fill [0]@ price, None Parent:93 Children:no_children
(Order ID:308) Type limit for breakout_100/NASDAQ_micro/20250600, qty [-1], fill [-1]@ price, 19729.25 Parent:93 Children:no_children
(Order ID:310) Type limit for breakout_100/NASDAQ_micro/20250600, qty [-1], fill [-1]@ price, 19724.75 Parent:93 Children:no_children
(Order ID:312) Type limit for breakout_100/NASDAQ_micro/20250600, qty [-1], fill [-1]@ price, 19719.5 Parent:93 Children:no_children
(Order ID:314) Type limit for breakout_100/NASDAQ_micro/20250600, qty [-1], fill [-1]@ price, 19716.5 Parent:93 Children:no_children
The docs say that any number of reasons can result in a mismatch between positions in DB and broker.
NOTE: I can't explain why 5 children were created nor why 4 orders were filled when 3 were expected.
I have experienced this issue now a few times and have found it difficult to figure out why. It seems to happen when opening a new position with multiple trades of qty 1 to execute and not all of them get transmitted automatically.
NOTE: I am using TWS to monitor the trades being generated as I learn and manually transmit them if they don't automatically.
Beta Was this translation helpful? Give feedback.
All reactions