Quote:
|
Originally Posted by forexts
Laguerre indicator: According to Ehlers description.
|
Wrong. A careful examination of the TimeWarp.doc (Ehlers) shows that this Emerald King version of Laguerre may NOT be compliant with the specs outlined in the Ehlers document.
Ehlers (part of code in question):
Vars: L0(0), L1(0), L2(0), L3(0), CU(0), CD(0), RSI(0);
L0 = (1 – gamma)*Close + gamma*L0[1];
L1 = - gamma *L0 + L0[1] + gamma *L1[1];
L2 = - gamma *L1 + L1[1] + gamma *L2[1];
L3 = - gamma *L2 + L2[1] + gamma *L3[1];
Emerald-King (errant version of code):
L0A = L0;
L1A = L1;
L2A = L2;
L3A = L3;
L0 = (1 - gamma)*Close[i] + gamma*L0A;
L1 = - gamma *L0 + L0A + gamma *L1A;
L2 = - gamma *L1 + L1A + gamma *L2A;
L3 = - gamma *L2 + L2A + gamma *L3A;
davidwt (correct and compliant version):
L0[i] = (1.0 - gamma)*Close[i] + gamma*L0[i+1];
L1[i] = -gamma*L0[i] + L0[i+1] + gamma*L1[i+1];
L2[i] = -gamma*L1[i] + L1[i+1] + gamma*L2[i+1];
L3[i] = -gamma*L2[i] + L2[i+1] + gamma*L3[i+1];
Basically, the time series requires calculations to include data from the previous bars, and the version posted does not include this in the code.