eSignal Wavelet Transform Dll: Wavelet Functions
Description of function TSWVL.DLL
Function RUNWVL
var d = newDLL("tsewvl.dll");
d.addFunction("runwvl",
DLL.FLOAT, DLL.STDCALL,"RUNWVL", DLL.FLOATARRAY,DLL.INT,DLL.FLOAT);
Returns value DeNoise
DLL.FLOATARRAY - Defines the
block (should be formed using eSignal)
DLL.INT - Number of scales (inside
dll number of bars are calculated using formula Lookback = Power(2, Scales); )
DLL.FLOAT - TraceHoldConstat
(for example 3)
Function GETALLVALUES
var
d = new DLL("tsewvl.dll");
d.addFunction("getallvalues",
DLL.FLOAT,
DLL.STDCALL,"GETALLVALUES", DLL.INT,DLL.INT);
Depending on parameters (I)
returns value of Redundant Haar, Noise Sigma or filtered coefficients.
I. Coefficients number
1.
Redundant Haar
2.
Noise Sigma
3.
Filtered coefficients (often is similar to Redundant Haar(I) or has
value 0 )
II.
Value number of coefficient in a row, 1, 2, etc. depending on number of scales,
if 8 scales then rows of values will be:
1.
(Redundant Haar) 8 scales + residue = 9.
2.
(Noise Sigma) 8 values
(Filtered coefficients) like with Redundant Haar 8 scales + residue = 9.
Example:
| eSignal Formula Script: | /******************************************************************* Name: TSE.Wavelet.Noise Analysis Type: Indicator Description: Example Indicator for Wavelet Transform DLL Used: tsewvl.dll Provided By: Trade Smart Research (c) Copyright 2001 - 2004 www.tsresearch.com *******************************************************************/ var v,lookback; /* Defining DLL */ var d = new DLL("tsewvl.dll"); /* Function Declaration */ d.addFunction("runwvl", DLL.FLOAT, DLL.STDCALL,"RUNWVL", DLL.FLOATARRAY,DLL.INT,DLL.FLOAT); /* Preparing parameters and array*/ function preMain() { setPriceStudy(false); setStudyTitle("Wavelet Noise"); setCursorLabelName("Noise", 0); setDefaultBarStyle(PS_SOLID, 0); setDefaultBarFgColor(Color.red, 0); setDefaultBarThickness(1, 0); setPlotType(PLOTTYPE_LINE, 0); ArrayPrice = new Array(512); var fp1 = new FunctionParameter("Scales", FunctionParameter.NUMBER); fp1.setLowerLimit(1); fp1.setUpperLimit(8); fp1.setDefault(4); var fp2 = new FunctionParameter("Source", FunctionParameter.STRING); fp2.setName("Source"); fp2.addOption("Close"); fp2.addOption("High"); fp2.addOption("Low"); fp2.addOption("Open"); fp2.setDefault("Close"); } function main(Scales,Source) { if (Scales==null) Scales=4; if (Source==null) Source="Close"; /* determinig length of array */ lookback=Math.pow(2,Scales); /* determinig source */ aSource=getValue(Source,0,-lookback); nBarIndex = getNumBars()+getCurrentBarIndex(); /* filling array */ if (nBarIndex >lookback) { for (x=0; x<lookback; x++) { ArrayPrice[x] = aSource[x]; } /* calling functoin in dll */ v = d.call("runwvl",ArrayPrice,Scales,3); } else { v=0 } return v; } |
|