开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: Issue with order.orderId Returning 0 in reqCompletedOrders(true)


 

As @ds-avatar indicated, orderIDs have a limited shelf life. They are only meaningful as long as the order is active and only for the client (as in clientID) that created the order. Keep in mind that each clientID has its own (permanent) sequence of orderIDs, that orderIDs must strictly increase for each new order placed, and that orderIDs might have to be adjusted ("bound") when one client gets in contact with an active order of a different client.
?
That is why each order also has a permID. IBKR assigns it when the order is accepted and returns properly adjusted Order objects with the openOrder() callbacks. That is where you'd get the permID from )or anz other aspect of the order that was changed by IBKR or the exchange)
?
The permID is also used to relate execution and commission reports to an order.
?
闯ü谤驳别苍
?
?
On Mon, Feb 17, 2025 at 12:29 AM, <joshi.tarun3107@...> wrote:

Hello Folks,

I am encountering an issue where order.orderId is consistently returning 0 when making the following request:
reqCompletedOrders(true);


I'm currently using Paper Trading account.

This occurs specifically in the completedOrder(const Contract& contract, const Order& order, const OrderState& orderState) callback response.

Has anyone else experienced a similar issue or found a solution for this behavior?

Looking forward to your insights.



Join [email protected] to automatically receive all group messages.