PGC Indicator For MT5

PGC Indicator For MT5

The PGC Indicator For MT5 is a momentum oscillator that measures cyclic changes in an underlying market. It is constructed by combining a Relative Strength Index (RSI) with two Moving Averages. The Price Gouging Cycle (PGC) oscillator gets displayed as a Blue curve in a separate pane, with 30 and 70 marked as default oversold and overbought levels, respectively.

Reversal from oversold-overbought zone in the direction of broader market trend represents valid, low risk signals. The PGC may also be applied to detect divergences between oscillator and price on any time frame and asset chart. Such divergence signals become more powerful when the oscillator trough/peaks get plotted beyond the oversold/overbought threshold.

FREE PGC Indicator

Download the FREE PGC 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 PGC 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 PGC.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 PGC Indicator For MT5

The PGC Indicator For MT5 has 7 parameters to configure.

input uint                 InpPeriod1        =  9;             // First MA period
input uint                 InpPeriod2        =  19;            // Second MA period
input uint                 InpPeriod3        =  6;             // Smoothing period
input uint                 InpPeriodRSI      =  8;             // RSI period
input ENUM_APPLIED_PRICE   InpAppliedPrice   =  PRICE_CLOSE;   // Applied price
input double               InpOverbought     =  70.0;          // Overbought level
input double               InpOversold       =  30.0;          // Oversold level

Buffers of the PGC Indicator For MT5

The PGC Indicator For MT5 provides 13 buffers.

SetIndexBuffer(0,BufferPGC,INDICATOR_DATA);
SetIndexBuffer(1,BufferMA1,INDICATOR_CALCULATIONS);
SetIndexBuffer(2,BufferMA2,INDICATOR_CALCULATIONS);
SetIndexBuffer(3,BufferAvgMA1,INDICATOR_CALCULATIONS);
SetIndexBuffer(4,BufferAvgMA2,INDICATOR_CALCULATIONS);
SetIndexBuffer(5,BufferE,INDICATOR_CALCULATIONS);
SetIndexBuffer(6,BufferAvgMA3,INDICATOR_CALCULATIONS);
SetIndexBuffer(7,BufferAvg2MA3,INDICATOR_CALCULATIONS);
SetIndexBuffer(8,BufferZ3,INDICATOR_CALCULATIONS);
SetIndexBuffer(9,BufferInc,INDICATOR_CALCULATIONS);
SetIndexBuffer(10,BufferDec,INDICATOR_CALCULATIONS);
SetIndexBuffer(11,BufferAvgInc,INDICATOR_CALCULATIONS);
SetIndexBuffer(12,BufferAvgDec,INDICATOR_CALCULATIONS);

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[])
  {
//--- @ gt 25@:0 8 @0AGQB : gt ;8G5AB20 ?@ gt AG8BK205 lt KE 10@ gt 2
   if(rates_total lt 4) return 0;
//--- @ gt 25@:0 8 @0AGQB : gt ;8G5AB20 ?@ gt AG8BK205 lt KE 10@ gt 2
   int limit=rates_total-prev_calculated;
   if(limit gt 1)
     {
      limit=rates_total-2;
      ArrayInitialize(BufferPGC,EMPTY_VALUE);
      ArrayInitialize(BufferMA1,0);
      ArrayInitialize(BufferMA2,0);
      ArrayInitialize(BufferAvgMA1,0);
      ArrayInitialize(BufferAvgMA2,0);
      ArrayInitialize(BufferE,0);
      ArrayInitialize(BufferAvgMA3,0);
      ArrayInitialize(BufferAvg2MA3,0);
      ArrayInitialize(BufferZ3,0);
      ArrayInitialize(BufferInc,0);
      ArrayInitialize(BufferDec,0);
      ArrayInitialize(BufferAvgInc,0);
      ArrayInitialize(BufferAvgDec,0);
     }
//---  gt 43 gt B gt 2:0 40==KE
   int count=(limit gt 1 ? rates_total : 1),copied=0;
   copied=CopyBuffer(handle_ma1,0,0,count,BufferMA1);
   if(copied!=count) return 0;
   copied=CopyBuffer(handle_ma2,0,0,count,BufferMA2);
   if(copied!=count) return 0;
   
   ExponentialMAOnBuffer(rates_total,prev_calculated,0,period_ma1,BufferMA1,BufferAvgMA1);
   ExponentialMAOnBuffer(rates_total,prev_calculated,0,period_ma1,BufferMA2,BufferAvgMA2);
   
   for(int i=limit; i gt =0 && !IsStopped(); i--)
     {
      double z1=2.0*BufferMA1[i]-BufferAvgMA1[i];
      double z2=2.0*BufferMA2[i]-BufferAvgMA2[i];
      BufferE[i]=z1-z2;
     }
   ExponentialMAOnBuffer(rates_total,prev_calculated,0,period_ma3,BufferE,BufferAvgMA3);   
   ExponentialMAOnBuffer(rates_total,prev_calculated,0,period_ma3,BufferAvgMA3,BufferAvg2MA3);
   
   for(int i=limit; i gt =0 && !IsStopped(); i--)
     {
      BufferZ3[i]=2.0*BufferAvgMA3[i]-BufferAvg2MA3[i];
      if(BufferZ3[i] gt BufferZ3[i+1])
        {
         BufferInc[i]=BufferZ3[i]-BufferZ3[i+1];
         BufferDec[i]=0;
        }
      else
        {
         if(BufferZ3[i] lt BufferZ3[i+1])
           {
            BufferInc[i]=0;
            BufferDec[i]=BufferZ3[i+1]-BufferZ3[i];
           }
         else
           {
            BufferInc[i]=0;
            BufferDec[i]=0;
           }
        }
     }
   ExponentialMAOnBuffer(rates_total,prev_calculated,0,period_rsi,BufferInc,BufferAvgInc);
   ExponentialMAOnBuffer(rates_total,prev_calculated,0,period_rsi,BufferDec,BufferAvgDec);

//---  0AGQB 8=48:0B gt @0
   for(int i=limit; i gt =0 && !IsStopped(); i--)
     {
      double RS=(BufferAvgDec[i]!=0 ? BufferAvgInc[i]/BufferAvgDec[i] : 0);
      BufferPGC[i]=100.0-100.0/(1.0+RS);
     }

//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

 

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.