开云体育

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

Re: Update order


 


Are you linking the STP order to the MOO via parentId?


On Fri, Jul 12, 2024 at 12:24 PM, Gonzalo Saenz via groups.io <yo=gnzsnz.com_at_groups_io_k21bj418pxe6c8_756s0895@...> wrote:

Hi,

I’m running an algo that triggers Market-on-Open orders. As it’s a MOO order the price is not known (although my logic will use a ticker to decide to trigger or not) at the time the order is created.

As I want to have a stop loss, I have added a commissionReportEvent handler. When orders are filled, I wait for the order to be fully filled, “trade.order.totalQuantity == fill.execution.cumQty” and I update the stop loss attached to the MOO order, with a stop loss price in line with the avg fill price.

This is working all fine. The problem that I have is that the updated order is never actually in status “submitted”. As per the orders notebook https://nbviewer.org/github/ib-api-reloaded/ib_async/blob/main/notebooks/ordering.ipynb, I update the order, execute placeOrder(contract,updated_order), status is ‘PendingSubmit’ then —> ‘PreSubmitted’ but it never reaches “Submited”

There is no error message, nothing on the log not TWS. I used to have some problems due to incorrect values on the order, but those were showing an actual error message. Now there is nothing.

Any pointer to the right direction will be appreciated.

Cheers







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