{******************************************************** Non-decimated Haar Wavelet Denoised & Residual Indicator Copyright (c) Trade Smart Research Group 2002 Notes: The math is based on Multiresolution Analysis of Time Series www.multiresolutions.com ********************************************************} Inputs: Price(Close), {a price series} Scales(6), { number of scales } NSigma(2); { threshold value signal / noise} vars: Lookback(0), count(0); { definition of variables } Array: ArrayPrice[511](0); {definition of Array} defineDLLFunc: "tswvl.DLL", FLOAT, "RUNWVL",LPFLOAT,int,float; {definition dll} defineDLLFunc: "tswvl.DLL", FLOAT, "GETALLVALUES",int,int; lookback = power(2, Scales); {calculation of quantity of elements of a Array} for count = 0 to lookback -1 begin ArrayPrice[count] = Price[count]; {the task of elements of Array} end; Value1 = RUNWVL(&ArrayPrice[0],Scales, NSigma); {the smoothed series} Value2 = Scales + 1; Value3 = GetAllValues(3, value2); Plot1(value1, "Denoised"); {drawing of charts} Plot2(value3, "Residual");
|