TP/SL orders not being placed in a strategy, Rithmic broker

Hello -

This topic was previously discussed here:

https://forum.ninjatrader.com/forum/ninjatrader-8/platform-technical-support-aa/1095638-sometimes-atm-strategies-don-t-attach-tp-and-stop-loss-orders

But I don’t find an answer. This seems like it could be a common issue. When I use a Sim account, I have no problems with my strategy placing TP/SL orders. Works every time. When I switch over to a broker account (Rithmic) I sometimes don’t get the orders placed, about 50% of the time. Any ideas on how to fix?

Thanks in advance for any help.

Sim fills instantly and in a fixed order; Rithmic often sends partial fills and delivers order and execution updates in a different order. If your code submits the stop and target when it sees OrderState.Filled in OnOrderUpdate, or uses Position.Quantity, it can miss them when the fill arrives in pieces. Submit or resize brackets from OnExecutionUpdate, using execution.Quantity and execution.Order, so every partial fill is covered. If you use an ATM template instead, check the Log tab when it fails: a reject (‘stop price outside limits’, ‘order rejected’) means the bracket was sent and refused. If nothing is logged, it was never sent, which points to the strategy code. Happy to help further, feel free to DM me.