Inputs: Price(close), Scales(4);
vars: Lookback(0), Sum(0), count(0), Residual(close), dResidual(0);
Array: ArrayPrice[511](0);
defineDLLFunc: "tswvl.DLL", FLOAT, "RUNWVL",LPFLOAT,int,float;
defineDLLFunc: "tswvl.DLL", FLOAT, "GETALLVALUES",int,int;
lookback = power(2, Scales); {number of bars, elements of block}
{block formation}
for count = 0 to lookback-1 begin
ArrayPrice[count] = Price[count];
end;
Value1 = RUNWVL(&ArrayPrice[0],Scales, 3); {calls Dll, sends the block}
Sum = 0;
for count = 1 to Scales begin
Sum = Sum + GetAllValues(2,Count); {all coefficients ar added up}
end;
Plot1(Sum, "Noise");