https://www.zorro-trader.com/manual/en/training.htm

Optimize entry parameters first and exit parameters afterwards. When your exit system is complex, optimize entry parameters with a simplified exit such as a simple stop. For using a simple exit while the entry parameters are optimized, evaluate the current parameter number (ParCycle), f.i. if(Train && ParCycle <= NumParameters-3) setExitSimple();.


var stoploss;
if(Train && ParCycle == NumTrainCycles){
var stoploss = ATR(4)*optimize(1.5,1.5,5.0,-5);
}else if(Train){
var stoploss = 0;
}


I have doubts above code will work, I want to train Stoploss in the last cycle only.
Seems like in train it works, but how are the parameters filled in live?

Somehow I have the feeling something is missing.