AIS Basic Window Functions
- Utilities
- Aleksej Poljakov
- Version: 4.0
- Updated: 6 September 2022
This script is designed to evaluate weights in various window functions. An indicator built on these window functions can be downloaded at https://www.mql5.com/ru/market/product/72160
Input parameters:
iPeriod – indicator period. iPeriod >= 2
iCenter is the index of the reference where the center of the window function will be located. By default, this parameter is 0 - the center of the window coincides with the center of the indicator. With 1 <= iCenter <= iPeriod, the center of the window function will be shifted, as a result of which some characteristics of the indicator will change. In Figure 1, you can see how the choice of the center affects the window function and the display of the indicator. This parameter can be changed in increments of 0.5.
Histogram width - the width of the histogram.
Histogram color - color of the histogram.
Show duration - display duration.
Screenshot - when this option is enabled, a picture is saved in the Files folder.
Some window functions use additional parameters - ParameterA and ParameterB. They affect the window weights. Because of this, the characteristics of the indicator change. The table shows the window functions and the limits for changing parameters if they are used.
Window | Parameter A | Parameter B |
---|---|---|
Bartlett - Hann window | ||
Blackman window | ||
Blackman window exact | ||
Blackman – Harris window | ||
Blackman – Harris window approx. | ||
Blackman – Harris window corr. | ||
Blackman - Harris window opt. | ||
Blackman – Harris window ref. | ||
Blackman - Nuttall window | ||
Bohman window | ||
Cauchy window | 0 <= ParameterA | |
Connes window | 1 < = ParameterA | |
Cosine gen. window 1st | 0 <= ParameterA <= 100 | |
Cosine gen. window 2nd | 0 <= ParameterA <= 100 | |
Dolph - Chebyshev window | 0 <= ParameterA | |
Flat Top window | ||
Flat Top window approx. | ||
Gauss window | 1 < = ParameterA <= 2*iPeriod | |
Gauss window approx. | 1 < = ParameterA <= 2*(iPeriod+1) | |
Gauss window conf. | 1 < = ParameterA <= 2*(iPeriod+1) | |
Gauss window gen. | 1 < = ParameterA <= 2*iPeriod | 0 <= ParameterB |
Hamming window | ||
Hamming window opt. | ||
Hann window | ||
Hann double window | ||
Hann - Poisson window | 0 <= ParameterA | |
Hyperbolic tangent window | 0 <= ParameterA | 0 <= ParameterB |
Kaiser window | 0 <= ParameterA | |
Kaiser - Bessel window | 0 <= ParameterA | |
Kaiser – Bessel window approx. | ||
Karre window | ||
Lanczos window | ||
Lanczos kernel window | 1 <= ParameterA | |
Log window | 1 <= ParameterA | |
Logistic window | ||
Modified cosine window | ||
Nuttall's window | ||
Parzen window | ||
Planck - Bessel window | 0 < = ParameterA <= iPeriod/2 | 0 <= ParameterB |
Plank-taper window | 0 < = ParameterA <= iPeriod/2 | |
Poisson window | 0 <= ParameterA | |
Rectangular window | ||
Rife – Vincent 3rd window | ||
Rife – Vincent 4th window | ||
Silverman window | 1 <= ParameterA | |
Sinusoidal windows | 0 <= ParameterA | |
Smoothed rectangular window | 0 < = ParameterA <= iPeriod/2 | |
Stepped window | 0 <= ParameterA | |
Triangular window | 0 < = ParameterA | |
Tukey window | 0 < = ParameterA <= iPeriod/2 | |
Welch window | 1 <= ParameterA |