Inside OnOrderUpdate I can set the proper Order object based on the order entry name. So now I have
Order longEntry1, longEntry2, longEntry3, shortEntry1, shortEntry2, shortEntry3
When the order is filled, inside OnOrderUpdate I can detect that by checking if (execution.Order.OrderState == OrderState.Filled) for each of my orders.
When that happens, I want to set the stoploss and profit targets for those orders using SetStopLoss and SetProfitTarget functions. These acceptthe name of the ENTRY order. There seems to be no way to set the name of the stoploss or profit target order itself.
Inside OnOrderUpdate, I also wantto check to see if a stoploss order or take profit order was rejected. For example, if a stoploss order is rejected, I should exit everything. The problem is that the only way I know of to check if the current order is a stoploss order is to use the order name. I knw that NT hardcodes the stoploss order name for single entries as "Stop loss" and "Profit target". But what if I have multiple entry orders? Are all stoploss and profit target orders just given the name "Stop loss" and "Profit target"? How can I differentiate between the stoploss for a given entry order?
Comment