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

Re: Not Average



PureBytes Links

Trading Reference Links

Why not to use two variables, like:

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

This should plot "right" Average

Andrey

----- Original Message ----- 
From: "Ian Waugh" <ianwaugh@xxxxxxxxx>
To: <omega-list@xxxxxxxxxx>
Cc: <ianwaugh@xxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, July 09, 2003 3:16 PM
Subject: Not Average


> 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
>