{******************************************************** Non-decimated Haar Wavelet Slope signal Copyright (c) Trade Smart Research Group 2002 Notes: The math is based on Multiresolution Analysis of Time Series www.multiresolutions.com ********************************************************} Inputs: EntryScale(6), {scale Wavelet for an input(entrance)} ExitScale(5); {scale вейвлета for an output(exit)} vars: Lookback(0), Scales(0), EntryWL(0), ExitWL(0), Count(0); Array: ArrayPrice[511](0); defineDLLFunc: "tswvl.DLL", FLOAT, "RUNWVL",LPFLOAT,int,float; { definition dll } defineDLLFunc: "tswvl.DLL", FLOAT, "GETALLVALUES",int,int; Scales = maxlist(EntryScale, ExitScale); lookback = power(2, Scales); for count = 0 to lookback-1 begin ArrayPrice[count] = Close[count]; end; Value1 = RUNWVL(&ArrayPrice[0],Scales, 0); {call dll function} EntryWL = GetAllValues(3,EntryScale); ExitWL = GetAllValues(3,ExitScale); Condition1 = EntryWL > EntryWL[1]; Condition2 = ExitWL > ExitWL[1]; If Condition1 = True and Condition2 = True Then Buy("Slope.LE") at close; If Condition1 = False and Condition2 = False Then Sell("Slope.SE") at close; If Condition2 = False Then ExitLong("Slope.LX") at close; If Condition2 = True Then ExitShort("Slope.SX") at close;
|