I am trying to code a variation of Perry Kaufmans Adaptive Moving Average The Equation is AMA= (ER*Close) + (1-ER)*AMA[1] It Returns ‘Blank’ Can anyone help? // parameter // n = 10 Change = ABS(close - close[n]) calc = ABS(close-close[1]) volat = summation[n](calc) ER = Change / volat once AMA=Average[n] AMA=(ER*Close)+(1-ER)*AMA[1] //or //V1=(1-ER) //V2=AMA[1] //V3=(V1*V2) //AMA=(ER*Close)+V3 Return AMA