I have a managed strategy that moves a stop (I think I understand the naming part but want to ensure proper cancelling of oco orders). So far these are the various states of the stop orders. The initial placement, the breakeven position, the initial trail stop location, then the trailing locations. Some of these are set in OnExecution, some in OnOrder or OnBarUpdate...
stopOrder_1a = ExitLongStop(0, true, execution.Order.Filled, execution.Order.AvgFillPrice - 14 * TickSize, "stopa", "a long limit entry"); stopOrder_1a = ExitLongStop(0, true, stopOrder_1a.Quantity, Position.AvgPrice+1*TickSize, "b/e-stopa", "a long limit entry"); stopOrder_1a = ExitLongStop(0, true, stopOrder_1a.Quantity, adjustedStopPrice, "init trail stopa", "a long limit entry"); stopOrder_1a = ExitLongStop(0, true, stopOrder_1a.Quantity, adjustedStopPrice, "trail stopa", "a long limit entry");
for example... if (stopOrder_1a.Name == "init trail stopa") stopOrder_1a = null;/*CancelOrder(stopOrder_1a);*/
Any help you can offer is appreciated.
Kirk


Comment