I have three different orders because I want to scale in and out of the position. I manage my stop loss and trailing stop with SetStopLoss and SetTrailStop methods.
Now I want to manage my Target Stop with IOrder objects. There is no other way !
So as soon as I get a fill on a long or short trade I place my Take profit stop on the OnExecution method down below. The problem is that they don't get triggered !
Do you see any bad coding there ?
On OnBarUpdate method :
if (BuyOrders > 0){
entryBOrder1 = EnterLongLimit(Cnts_firstTarget,BuyOrders,"aL");
entryBOrder2 = EnterLongLimit(secondTarget_Cnts,BuyOrders,"bL");
entryBOrder3 = EnterLongLimit(thirdTarget_Cnts,BuyOrders,"cL");
} if(SellOrders < 999999){
entrySOrder1 = EnterShortLimit(Cnts_firstTarget,SellOrders,"aS");
entrySOrder2 = EnterShortLimit(secondTarget_Cnts,SellOrders,"bS");
entrySOrder3 = EnterShortLimit(thirdTarget_Cnts,SellOrders,"cS");
}

Comment