You are correct. A better name for the Order quantity field would probably be "current quantity" or "remaining quantity". IBKR automatically decrements the field value after each partial fill. Or in case of child orders in a Bracket Order, IBKR will automatically sets quantities for all child orders to the actual fill quantity of the parent . And your client application can adjust the value at any point in time, too (up or down). If you need the original order quantity for orders at time of placement, you need to persist that information within the scope of your client application. Or if you want to avoid having to save state, you can use the OrderRef field as I had pointed out before. It is perfectly fine if you define a few context fields, encode them, for example, as a Json string, and store that string in the OrderRef field of the order. The OrderRef field description is best summarized in the Execution class as:
For the special case where your client applications do not change the order quantity after order placement, you can reconstruct the original order quantity from the orderStatus() callback. Each time you receive an orderStatus() update, it provides the actual "filled" and "remaining" quantities at that point in time. 闯ü谤驳别苍 ? ? On Fri, Sep 27, 2024 at 06:40 PM, Jesse Stone wrote:
|