PureBytes Links
Trading Reference Links
|
On Feb 25, 6:45pm, Earl Adamy wrote:
> Subject: Re: returning value of previous calc?
> It appears that you are assuming (hoping <g>) that the simple function variables
> are static i.e. remain intact when function has finished executing. The result
> you are getting is telling you that the simple function variables are dynamic
> i.e. recreated on function entry and destroyed upon function exit. I'm also
> fighting with series functions - the fact that series functions are "pulled out"
> (as Mark Jurik put it) and solved before the rest of the code poses a number of
> limitations.
>
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 exmponential moving average. From that example, I assumed/hoped
that variables (even for simple functions) would remember their
previous value (and to do that, they'd have to be statically allocated).
Looks like no schlitz, and another case for global variables.
Ironically, I was writing this EL code, to avoid having to develop
and/or use another DLL [global variables or otherwise]. Looks like
I'll have to physically duplicate the function's code in the various
indicators and functions that need it, if I go the non-DLL route.
--
--
| Gary Funck, Intrepid Technology, gary@xxxxxxxxxxxx, (650) 964-8135
|