I just noticed that my opened position in the contest has no trailing stop. The order was opened on the remote server. When I tested it locally, the trailing stop was working. Could the fact that my strategy is running in the remote server be causing the problem because I'm using order.waitForUpdate(800) immediately after opening the order? Here's the code.
order = engine.submitOrder(label, instrument, IEngine.OrderCommand.BUY,
lot, 0, SLIPPAGE, stopLoss, takeProfit);
order.waitForUpdate(800);
order.setStopLossPrice(stopLoss, OfferSide.BID, trailStep);
Would increasing the timeout help?