I agree with Ddlv, a series would be better.
I'd assumed on a quick look that you had used series, so my references to ITrend[1] not existing is of course only true if it was series like Price but not for the array.
vars Price = series(price());
vars ITrendline = series();
if (Bar < 4)
{
ITrendline[0] = Price[0];
}
else
{
ITrendline[0] = (((Alfa - ((Alfa /2) * (Alfa/2))) * Price[0])
+ (((Alfa * Alfa)/2) * Price[1])
- ((Alfa - ((3 * (Alfa * Alfa)) / 4)) * Price[2])
+ ((2*(1-Alfa)) * ITrendline[1])
- (((1-Alfa) * (1-Alfa)) * ITrendline[2]));
}
Seems to work.