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

Re: returning value of previous calc?



PureBytes Links

Trading Reference Links

-----Original Message-----
From: Gary Funck <gary@xxxxxxxxxxxx>
To: Earl Adamy <eadamy@xxxxxxxxxx>; omega-list@xxxxxxxxxx
<omega-list@xxxxxxxxxx>
Date: Wednesday, February 25, 1998 6:49 PM
Subject: Re: returning value of previous calc?

>You got it, Earl.  What confused me, is that I've seen example uses
>of 'simple' (non-series) functions that make use of the previous
>value of the function.  The example given, was a method for calculating
>an exponential moving average.  From that example, I assumed/hoped


When I attempt a direct backward reference (variable[n]) or indirect backward
reference (a crosses above b) in a simple function I get syntax errors. An Xavg
requires reference to the previous period value, so if you've got an example
where backward reference is performed withing the function, I'd like to see how
it's done. As I think about it, the example you saw probably recurses the same
variable so that the value being passed to the next iteration of the function is
the same as the value returned by the previous iteration e.g.  xAvg =
f_xavg(xAvg)?

Earl