My plan is for this to activate provided the trade is in profit and more than 1 bar has occurred. With the current code I'm using, the initial stop loss works, but the trailing part doesn't. For reference, calculate is set to OnBarClose.
Here's what I have So far for the custom trailing:
if (BarsSinceEntryExecution() > 1){
SetStopLoss("MACD Oppourtunity Long",CalculationMode.Price,lastBarLow,false);
}
if (BarsSinceEntryExecution() > 1){
SetStopLoss("MACD Oppourtunity Short",CalculationMode.Price,lastBarHigh,false);
}
if (goodToTradeLong == true){ // if I have no active trades and I'm ready to go Long
EnterLongLimit(0, false, contracts, GetCurrentAsk() ,"MACD Oppourtunity Long");
SetStopLoss(CalculationMode.Ticks, InitialStopLoss);
SetProfitTarget("MACD Oppourtunity Long", CalculationMode.Price,dayHigh,true);
}
if (goodToTradeShort == true){ // if I have no active trades and I'm ready to go Short
EnterShortLimit(0, false, contracts, GetCurrentAsk() ,"MACD Oppourtunity Short");
SetStopLoss(CalculationMode.Ticks, InitialStopLoss);
SetProfitTarget(CalculationMode.Price,dayLow,true) ;
}

Comment