PdfMA awesome oscillator Indicator For MT5

PdfMA awesome oscillator Indicator For MT5

The PdfMA awesome oscillator Indicator For MT5 displays a uniquely constructed Awesome Oscillator. The Awesome Oscillator was originally developed by Bill Williams. It consists of a histogram that shows the price momentum of an underlying asset during a given period of time compared to a larger time scale. Despite its fancy name, the formula to calculate the Awesome Oscillator is rather simple. It is the difference between a 34-period Simple Moving Average and a 5-period Simple Moving Average. However, unlike other conventional price averages, the Simple Moving Averages are not based on closing price, but instead utilize the mid-point of each price bar.

This version of the Awesome Oscillator uses Probability Density Function Weighted Moving Average (PDFMA) in place of the Simple Moving Average (SMA). The PDFMA is a type of weighted average that employs probability density function to compute the coefficients and the average values.

The creator of the PdfMA awesome oscillator Indicator For MT5 advises traders to use histogram color changes, especially on zero line crossovers, as trend change signals.

FREE PdfMA awesome oscillator Indicator

Download the FREE PdfMA awesome oscillator Indicator for MT5.

To receive my email 100% sure: 
Put my email on your whitelist!

 

Partially Automated Trading Besides Your Day Job

Alerts In Real-Time When Divergences Occur

My Recommended MT4/MT5 Broker

 

Installing the PdfMA awesome oscillator Indicator For MT5

After you downloaded the indicator via the form above you need to unzip the zip-file. Then you need to copy the file PdfMA awesome oscillator.mq5 into the folder MQL5\Indicators of your MT5 installation. After that please restart MT5 and then you will be able to see the indicator in the list of indicators.

Parameters of the PdfMA awesome oscillator Indicator For MT5

The PdfMA awesome oscillator Indicator For MT5 has 1 parameters to configure.

input double inpVariance = 2; // Variance

Buffers of the PdfMA awesome oscillator Indicator For MT5

The PdfMA awesome oscillator Indicator For MT5 provides 2 buffers.

SetIndexBuffer(0,val,INDICATOR_DATA);
SetIndexBuffer(1,valc,INDICATOR_COLOR_INDEX);

Main Parts Of The Code

int OnCalculate(const int rates_total,const int prev_calculated,const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
   int i= prev_calculated-1; if (i lt 0) i=0; for (; i lt rates_total && !_StopFlag; i++)
   {
      double _price  = (high[i]+low[i])/2.0;
      val[i]  = iPdfMaFast.calculate(_price,i)-iPdfMaSlow.calculate(_price,i);
      valc[i] =  (i gt 0) ? (val[i] gt 0) ? (val[i] gt val[i-1]) ? 0 : 1 : (val[i] lt val[i-1]) ? 2 : 3 : 0;
   }
   return(i);
}

//------------------------------------------------------------------
// Custom function(s)
//------------------------------------------------------------------
//
//---
//

class cPdfMa
{
   private :
         int    m_period;
         int    m_arraysize;
         double m_work[];
         double m_coeffs[];
         double m_coeffw;
                     
   public : 
         cPdfMa() { init(1,1,0); }
        ~cPdfMa() {};
   
         //
         //
         //
         
         void init(int period, double variance) { init(period,variance,0); }
         void init(int period, double variance, double mean)
         {
            m_period    = (period gt 1) ? period : 1;
            m_arraysize = m_period+32;
            m_coeffw    = 0; 

               ArrayResize(m_work,m_arraysize); ArrayInitialize(m_work,0);
               ArrayResize(m_coeffs,m_period);

               //
               //---
               //
               
               #define maxx 3.5
               #define pdf(_x,_variance,_mean) (1.0/MathSqrt(2*M_PI*_variance*_variance)*MathExp(-((_x-_mean)*(_x-_mean))/(2*_variance*_variance)))
         
                     if (variance  lt  0.01) variance = 0.01;
                     if (mean      lt  -1)   mean     = -1;
                     if (mean      gt   1)   mean     =  1;
                        if (m_period gt 1)
                              { 
                                 double step = maxx/(m_period-1); 
                                 for(int i=0; i lt m_period; i++) 
                                 { 
                                    m_coeffs[i] = pdf(i*step,variance,mean*maxx); 
                                    m_coeffw   += m_coeffs[i]; 
                                 }
                              }
                        else  { m_coeffs[0] = m_coeffw = 1; }
         
               #undef pdf #undef maxx  
         }
         
         double calculate(double price, int i)
         {
            int _indC = (i)%m_arraysize; m_work[_indC] = price;
            double _avg = 0; 
                  for (int k=0; k lt m_period; k++,_indC--) 
                  { 
                     if (_indC lt 0) _indC += m_arraysize; 
                                  _avg  += m_work[_indC]*m_coeffs[k]; 
                  }
            return(_avg/m_coeffw);
         }
};
cPdfMa iPdfMaFast,iPdfMaSlow;
//------------------------------------------------------------------

 

About Me

I'm Mike Semlitsch the owner of PerfectTrendSystem.com. My trading career started in 2007. Since 2013 I have helped thousands of traders to take their trading to the next level. Many of them are now constantly profitable traders. 

The following performance was achieved by me while trading live in front of hundreds of my clients:

Connect With Me:  

Results From 5 Months!
This service starts soon! Be the first who get's notified when it begins!

This FREE Indicator Can Transform
Your Trading!

FREE Indicator + Telegram Group


Request the Ultimate Double Top/Bottom Indicator which is used by 10,000+ traders.