I'm trying to implement in Zorro this R code provided in this site: IGM strategy

The code looks like this:

Code
vars Returns[6];
var  cumRets[6];
int  days = 0;	

function run()
{
//	set(PARAMETERS+LOGFILE+PLOTNOW);
	set(LOGFILE+PLOTNOW);
	BarPeriod    = 1440;
	LookBack     = 240;
	Verbose      = 0;
	NumWFOCycles = 5;
	
	
	
	int i;
	for(i=0;i<6;i++)
	{
		asset(Assets[i]);
		Returns[i] = series((price(0)-price(1))/price(1));
	}
	
	days++;
	
	if (days%20 == 0 && days>240) { // once a month do
		exitTrade();
		while(asset(loop("MDY", "TLT", "EEM", "ILF", "EPP", "FEZ")))
		{
			vars retSubset = Returns[Itor1];
			cumRets[Itor1] = Sum(retSubset,optimize(60,20,240,20));
		}
		
		int * Idx = sortIdx (cumRets, -6);
//		printf("\n %i", Idx[0]);
		asset(Assets[Idx[0]]);
		enterLong();
	}

}


The TEST phase works correctly, but the TRAIN phase optimize the last asset only, then the TEST issue an error that no .par file is available for each asset.
The manual explains that the TRAIN runs each asset with all available parameters value, then continue to the next asset.
In this specific strategy the position is taken only after all assets are ranked by their returns, in my understanding the current TEST approach can't handle such situation.
Am I correct or there is some hack to overcome this situation?