Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Indicator | XPercentR-PCR

Real Author:

Scorpion@fxfisherman.com

The simple oscillator indicator displayed as colored cloud. The color of cloud indicates the direction of trend.

Indicator Input Parameters:

//+----------------------------------------------+
//|  Indicator input parameters                  |
//+----------------------------------------------+
input uint  HL_Period=55;
//----
input Smooth_Method SmoothMethod=MODE_JJMA; // Smoothing method
input uint SmoothLength=3;                  // Smoothing depth                    
input int SmoothPhase=100;                  // Smoothing parameter
input uint UpLevel=80;                      // Overbought level
input uint DnLevel=20;                      // Oversold level
input color UpLevelsColor=Purple;           // Overbought level color
input color DnLevelsColor=Purple;           // Oversold level color
input STYLE Levelstyle=DASH_;               // Levels style
input WIDTH  LevelsWidth=Width_1;           // Levels width  

This indicator allows to select averaging algorithms out of ten possible versions:

  1. SMA - simple moving average
  2. EMA - exponential moving average
  3. SMMA - smoothed moving average
  4. LWMA - linear weighted moving average
  5. JJMA - JMA adaptive average
  6. JurX - ultralinear smoothing
  7. ParMA - parabolic smoothing
  8. T3 - Tillson's multiple exponential smoothing
  9. VIDYA - smoothing with the use of the Tushar Chande's algorithm
  10. AMA - smoothing with the use of the Perry Kaufman's algorithm

It should be noted that Phase parameters for different smoothing algorithms have completely different meaning. For JMA it is the Phase external variable changing from -100 to +100. For T3 it is the smoothing ratio multiplied by 100 for better visualization, for VIDYA it is the CMO oscillator period and for AMA it is the slow EMA period. In other algorithms these parameters do not affect smoothing. For AMA, the fast EMA period has a fixed value and is equal to 2 by default. The ratio of raising to the power is also equal to 2 for AMA.

The indicator uses SmoothAlgorithms.mqh library classes (must be copied to the terminal_data_folder\MQL5\Include). The use of the classes was thoroughly described in the article "Averaging Price Series for Intermediate Calculations Without Using Additional Buffers".

MetaTrader Experts, Indicators, Scripts and Libraries

Fig.1 The XPercentR-PCR Indicator

1030

Best MetaTrader Indicators + Profitable Expert Advisors