1. when the stop loss order is filled, part of profit target order is not getting closed automatically. when the profit target order is filled, part of stop loss order is not getting closed automatically.
2. the OnExecutionUpdate is not getting called for all the part filled event and filled event. Due to this, SL/PT order is not placed for all the orders filled.
onBarUpdate() {
EnterLongStopLimit(0, true, NoOfContracts, longEntryPrice, longEntryPrice ,"$Long");
}
OnExecutionUpdate(){
longStopOrder = ExitLongStopMarket(0, true, execution.Order.Filled, longSLPrice, "lstop", "$Long");
longTargetOrder = ExitLongLimit(0, true, execution.Order.Filled, targetPrice, "ltarget", "$Long");
}

Comment