*****Correction******
Actually the correct way of the last part should be like this:
For the high levels:
Level1[i]=Close[0] *MathExp((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 1);
Level2[i]= Close[0] * MathExp((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 1.645);
Level3[i]=Close[0] * MathExp((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 1.96);
Level4[i]=Close[0] * MathExp ((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 2.576);
For the low levels:
Level1[i]=Close[0] *(2- MathExp((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 1));
Level2[i]= Close[0] * (2-MathExp((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 1.645));
Level3[i]=Close[0] * (2-MathExp((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 1.96));
Level4[i]=Close[0] * (2-MathExp ((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 2.576));
Good Luck....
Actually the correct way of the last part should be like this:
For the high levels:
Level1[i]=Close[0] *MathExp((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 1);
Level2[i]= Close[0] * MathExp((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 1.645);
Level3[i]=Close[0] * MathExp((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 1.96);
Level4[i]=Close[0] * MathExp ((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 2.576);
For the low levels:
Level1[i]=Close[0] *(2- MathExp((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 1));
Level2[i]= Close[0] * (2-MathExp((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 1.645));
Level3[i]=Close[0] * (2-MathExp((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 1.96));
Level4[i]=Close[0] * (2-MathExp ((MathSqrt(BarsRemaining) * LeastSquareVolatility) * 2.576));
Good Luck....