thank you andrew i get it in this way if it can help other forum's users
Code
	
vars Price = series(priceClose());
int per = 50;
int x = 3;
 int i = optimize(0,0,2,1);
 vars Trends1;
vars Trends2;
   if(i == 0) {
		Trends1 = series(SMA(Price,per));
		Trends2 = series(SMA(Price,per*x));
		}  
	else if(i ==	1) {
		Trends1 = series(EMA(Price,per));
		Trends2 = series(EMA(Price,per*x));
		}       
	else if(i ==	2) { 
	Trends1 = series(TEMA(Price,per));
	Trends2 = series(TEMA(Price,per*x));
	}    


but i still dont understand what im doing wrong in the previous array. I still get the syntax error and i tried various combination of ";","}", "," or blank spaces but nothing, still get the same error