[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Not Average



PureBytes Links

Trading Reference Links

I'm having trouble with Average. Probably just not got my head around 
something but would appreciate a pointer...

I'm calculating the difference between this bar's close and the previous 
bar's close and trying to plot the 3-bar average but I get different 
results depending on when the Average is taken. For example:

diff=c-c[1];
plot1(average(diff,3),"diff");

    produces a different plot to:

diff=c-c[1];
diff=average(diff,3);
plot1(diff,"diff");

I would have assumed they'd plot the same plot. Where am I going wrong?

Ian