hi guys is it possible obtain something like this?
Code
vars Price = series(priceClose());
var per = 50;
  int i = optimize(0,0,2,1);
vars a[3] = {
                    series(SMA(Price,per)),
                    series(EMA(Price,per)),
                   series(TEMA(Price,per))
                    };
vars Trends1 = a[i];
if(crossOver(Price,Trends1))
enterLong;
if(crossUnder(Price,Trends1))
exitLong;


obviously it goes on error frown
thanks