Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
Update order
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 , 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 |
Are you linking the STP order to the MOO via parentId? Hi, |
toggle quoted message
Show quoted text
|
The only other thing I can think of is that the STP isn’t getting transmitted (transmit=False) but I believe the default is transmit=True, however I don’t know offhand how a non-transmitted order’s order status presents. Yes, STP has it’s parentId=MOO.orderId |
开云体育?This is what I thought too. I have updated my code, let’s see on Monday. When I attach the stop loss order, I enter transmit=False to all orders, except the last attachment. I realised earlier today that on the log "Transmit=False”, which how I entered it. Now I can only wait to Monday. Thanks for your inputs.
|
toggle quoted message
Show quoted text
|
to navigate to use esc to dismiss