PureBytes Links
Trading Reference Links
|
I am new to EL but not new to programming. It appears that EL
can reference back values of calculated variables ie., VALUE1[3],
VALUE4[15], etc. How many levels can this be taken to? In other
languages, I would have to define an array for each variable that
stores previous values.
Is this simple example valid (MaxBarsBack = 20):
Value1 = Close Of Data1;
Value2 = (Value1[0] + Value1[1] + Value1[2] + Value1[3]) * 0.25;
Value3 = Value2[0] - Value2[19];
Value4 = (Value3[0] + Value3[1] + Value3[2] + Value3[3]) * 0.25;
Value5 = Value2[10] + Value3[15] + Value4[2];
The only purpose for this nonsense example is to question lookback
action. The data is smoothed with a simple MA, a 20 day difference
of the MA is taken, then it is smoothed with another simple MA.
Value5 shows that past values of the other variables are still
available to use. Note that Value2[10] is beyond the originally
calculated range but < MaxBarsBack. Is this all OK?
If so, is there any downside to letting EL automatically dimension
the lookback (speed, memory usage, etc.) rather than me manually
declaring arrays and doing all the work myself?
Thanks, Barry Kaufman.
|