PCI Indicator For MT5

PCI Indicator For MT5

The PCI Indicator For MT5 allows you to find the overbought and oversold condition of the trading instrument based on the simple colored histogram bars. But taking the reading from the indicator is a little bit complex as you have to rely on the different color sequences. Red bars followed by the green bars above the 50 mark of the indicator suggest the market is going for the bearish rally. For the bullish rally, you notice green color bars followed by the blue bars below the 50 mark. To learn its use properly you must rely on the higher time frame data or else it will be tough to find the best possible trades.

FREE PCI Indicator

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

The PCI Indicator For MT5 has 4 parameters to configure.

input uint                 InpPeriod         =  34;            // Period
input ENUM_APPLIED_PRICE   InpAppliedPrice   =  PRICE_CLOSE;   // Applied price
input double               InpOverbought     =  80.0;          // Overbought
input double               InpOversold       =  20.0;          // Oversold

Buffers of the PCI Indicator For MT5

The PCI Indicator For MT5 provides 6 buffers.

SetIndexBuffer(0,BufferH1,INDICATOR_DATA);
SetIndexBuffer(1,BufferColors,INDICATOR_COLOR_INDEX);
SetIndexBuffer(2,BufferH3,INDICATOR_DATA);
SetIndexBuffer(3,BufferPCI,INDICATOR_DATA);
SetIndexBuffer(4,BufferMA,INDICATOR_CALCULATIONS);
SetIndexBuffer(5,BufferSignal,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-period-1;
      ArrayInitialize(BufferH1,EMPTY_VALUE);
      ArrayInitialize(BufferH3,EMPTY_VALUE);
      ArrayInitialize(BufferPCI,EMPTY_VALUE);
      ArrayInitialize(BufferMA,0);
      ArrayInitialize(BufferSignal,0);
     }
//---  gt 43 gt B gt 2:0 40==KE
   int count=(limit gt 1 ? rates_total : 1),copied=0;
   copied=CopyBuffer(handle_ma,0,0,count,BufferMA);
   if(copied!=count) return 0;

//---  0AGQB 8=48:0B gt @0
   for(int i=limit; i gt =0 && !IsStopped(); i--)
     {
      double Momentum=(BufferMA[i]-BufferMA[i+period-1])/period;
      double Up=0,Dn=0;
      for(int j=0; j lt =period; j++)
        {
         double Gradient=BufferMA[i+period]+Momentum*j;
         if(BufferMA[i+period-j]-Gradient gt 0.)
            Up+=fabs(BufferMA[i+period-j]-Gradient);
         else if(BufferMA[i+period-j]-Gradient lt 0.)
            Dn+=fabs(BufferMA[i+period-j]-Gradient);
        }

      BufferPCI[i]=(Up+Dn!=0 ? 100.0*Up/(Up+Dn) : 0);
      if(Momentum gt 0)
        {
         if(BufferPCI[i] lt oversold)
            BufferSignal[i]=1;
         else
            BufferSignal[i]=BufferSignal[i+1];
        }
      else
        {
         if(BufferPCI[i] gt overbought)
            BufferSignal[i]=-1;
         else
            BufferSignal[i]=BufferSignal[i+1];
        }

      if(BufferSignal[i]==1)
        {
         if(BufferPCI[i] gt 50)
           {
            BufferH1[i]=BufferPCI[i];
            BufferH3[i]=50;
           }
         else
           {
            BufferH1[i]=50;
            BufferH3[i]=BufferPCI[i];
           }
         BufferColors[i]=0;
        }
      else
        {
         if(BufferSignal[i]==-1)
           {
            if(BufferPCI[i] gt 50)
              {
               BufferH1[i]=BufferPCI[i];
               BufferH3[i]=50;
               BufferColors[i]=1;
              }
            else
              {
               BufferH1[i]=50.;
               BufferH3[i]=BufferPCI[i];
              }
            BufferColors[i]=1;
           }
        }

     }

//--- 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.