This indicator is based on indicator AbsolutelyNoLagLwma and on the analysis of its multiple signal lines. Signal lines calculation algorithm is as follows. Any period value from the multitude of signal lines is calculated using arithmetic progression:
SignalPeriod(Number) = StartLength + Number * Step
The value of Number variable ranges from zero to StepsTotal. The obtained values ​​of the periods are added to the array of variables and are used at each tick of the indicator to get an array of the indicator’s smoothed values. Based on that array, the directions of the current trend are calculated for each smoothing, and the numbers of positive and negative trends are found for the entire array the smoothed AbsolutelyNoLagLwma values.
The final numbers of positive and negative trends are smoothed and used as the indicator lines that form a color histogram displayed using the DRAW_COLOR_HISTOGRAM2 style class. Trend direction in this indicator is determined by the histogram color, while its power is determined by the histogram width.
To indicate the trend, four colors are used for each of the two trend directions: If the histogram values do not enter the overbought/oversold areas, then the indicator colors are darker, while they become lighter when the overbought/oversold levels are broken through.
Inputs of the indicator are
//+----------------------------------------------+ //| Indicator input parameters                 | //+----------------------------------------------+ input uint FLength=7;                                // smoothing depth                  input Applied_price_ IPC=PRICE_CLOSE_;              // price cconstant //---- input Smooth_Method W_Method=MODE_JJMA;            // Smoothing method input int StartLength=3;                            // Initial smoothing period                    input int WPhase=100;                              // Smoothing parameter //----  input uint Step=5;                                  // Period changing step input uint StepsTotal=10;                          // Number of changes in the period //---- input Smooth_Method SmoothMethod=MODE_JJMA;        // Smoothing method input int SmoothLength=3;                          // Smoothing depth input int SmoothPhase=100;                          // Smoothing parameter //----                          input uint UpLevel=80;                              // Overbought level in %% input uint DnLevel=20;                              // Oversold level in %% input color UpLevelsColor=Blue;                    // Overbought level color input color DnLevelsColor=Blue;                    // Oversold level color input STYLE Levelstyle=DASH_;                      // Levels style input WIDTH  LevelsWidth=Width_1;                  // Levels thickness       Â
Smoothing algorithms can be selected out of ten possible versions:
- SMA – simple Moving Average;
- EMA – exponential Moving Average;
- SMMA – smoothed Moving Average;
- LWMA – linear weighted moving average;
- JJMA – adaptive averaging JMA;
- JurX – ultralinear averaging;
- ParMA – parabolic smoothing;
- T3 – Tillson’s multiple exponential smoothing;
- VIDYA – smoothing with the use of Tushar Chande algorithm;
- AMA – smoothing using Perry Kaufman’s algorithm.
It should be noted that Phase type parameters for different smoothing algorithms have completely different meaning. For JMA it is an external Phase variable changing from -100 to +100. For T3 it is a smoothing ratio multiplied by 100 for better visualization, for the VIDYA it is a CMO oscillator period and for the AMA it is a slow EMA period. In other algorithms these parameters do not affect the averaging. For AMA fast EMA period is a fixed and equal to 2 by default value. The ratio of raising to the power is also equal to 2 for AMA.
The indicator uses SmoothAlgorithms.mqh library classes (copy it to <terminal_data_folder>\MQL5\Include). The use of the classes was described in detail in the article “Averaging Price Series for Intermediate Calculations Without Using Additional Buffers”.
Fig 1. Inicator UltraAbsolutelyNoLagLwma