{******************************************************** Non-decimated Haar Wavelet Coefficients Copyright (c) Trade Smart Research Group 2002 Notes: The math is based on Multiresolution Analysis of Time Series www.multiresolutions.com ********************************************************} Inputs: Price(MedianPrice), { a price series } FirstScale(4) { number of scales must be <= 6 }, NSigma(3); { threshold value signal / noise } vars: count(0), scales(1); {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; scales = FirstScale + 4; for count = 0 to power(2, Scales) - 1 begin {the task of elements of Array} ArrayPrice[count] = Price[count]; end; Value2 = RUNWVL(&ArrayPrice[0], scales, NSigma); {call dll function} Value3 = GetAllValues(3,FirstScale); Value4 = GetAllValues(3,FirstScale + 1); Value5 = GetAllValues(3,FirstScale + 2); Value6 = GetAllValues(3,FirstScale + 3); Plot1(value3, "First"); { drawing of charts } Plot2(value4, " First +1"); Plot3(value5, " First +2"); Plot4(value6, " First +3");
|