Overview: Wavelet Trend Nowcast Signal
Example 8. . The signal that opens positions if trend is identified on the given scale, and closing them if the end of trend is fond.

Here is the report of the non-optimized system. It shows remarkable robustness concerning the parameter NSigma from "theoretically proved" range 2-3 that corresponds 95-99 % of Gaussian noise amplitude. The concrete scale is expedient for choosing from the middle of scales, from the third to the fifth.
| EasyLanguage: | {******************************************************** Non-decimated Haar Wavelet Trend Nowcast Signal Copyright (c) Trade Smart Research Group 2002 Notes: The math is based on Multiresolution Analysis of Time Series www.multiresolutions.com ********************************************************} Inputs: Scale(5), {wavelet scale} NSigma(3); {threshold value signal / noise} vars: Wavelet(0), Sigma(0), Trend(0), countarray(0), num(1); Array: ArrayPrice[511](0); defineDLLFunc: "tswvl.DLL", FLOAT, "RUNWVL",LPFLOAT,int,float; defineDLLFunc: "tswvl.DLL", FLOAT, "GETALLVALUES",int,int; for countarray = 0 to 255 begin ArrayPrice[countarray] = Close[countarray]; end; Value1 = RUNWVL(&ArrayPrice[0], 8, NSigma); Wavelet = GetAllValues(1, Scale); Sigma = GetAllValues(2, Scale); if Wavelet > NSigma * Sigma then Trend = 1 else if Wavelet < - NSigma * Sigma then Trend = -1 else Trend = 0; if Trend = 1 then buy("NCast.LE") num contracts at close; if Trend = -1 then sell("NCast.SE") num contracts at close; if Trend = 0 and marketposition = 1 then ExitLong("NCast.LX") at close; if Trend = 0 and marketposition = -1 then ExitShort("NCast.SX") at close;
|
|