Hi, I have a pairs trading script which works correctly in [Test] mode.
I am adding the optimize(..) function to it, in order to optimize according to best Period (TimeFrame) and best LookBack. I use these lines to optimize:

Code:
set(LOGFILE|PARAMETERS);
	DataSplit = 90;
	NumWFOCycles = 10;
	//BarPeriod = 15;
	int Periods[2] = {1440,240};
	BarPeriod = Periods[round(optimize(1,0,1,1),1)];
	PlotWidth = 650;
	StartDate = 20150101; 
	EndDate = 20151201; 
	int lookBacks[2] = {150,300};
	LookBack = lookBacks[round(optimize(1,0,1,1),1)];



But it does not optimize with the 2 assets, it only "discovers" the asset I have marked when running "Train" mode, so every Step of the optimization gets "0", because it couldn't get the second asset's prices.

Is there any sample script in the manual which I could take a look in order to do this?

Thanks!