My order submission code looks like this :
==========================
mainOrder = cxt.createStopOrder(entryOrderAction, TIF.GTC, qty, entryPoint);
stoploss = cxt.createStopOrder(mainOrder.getOrderId(), exitOrderAction, TIF.GTC, qty, stopLossVal);
target = cxt.createLimitOrder(mainOrder.getOrderId(), exitOrderAction, TIF.GTC, qty, takeProfitVal);
cxt.submitOrders(mainOrder, stoploss, target);
==========================
This works well on simulation
==========================
mainOrder = cxt.createStopOrder(entryOrderAction, TIF.GTC, qty, entryPoint);
stoploss = cxt.createStopOrder(mainOrder.getOrderId(), exitOrderAction, TIF.GTC, qty, stopLossVal);
target = cxt.createLimitOrder(mainOrder.getOrderId(), exitOrderAction, TIF.GTC, qty, takeProfitVal);
cxt.submitOrders(mainOrder, stoploss, target);
==========================
This works well on simulation