PChannel_System Indicator For MT5

PChannel_System Indicator For MT5

The PChannel_System Indicator For MT5

FREE PChannel_System Indicator

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

The PChannel_System Indicator For MT5 has 2 parameters to configure.

input uint period=20;       // Extrema finding period
input uint   Shift=2;       // Horizontal shift of the channel in bars

Buffers of the PChannel_System Indicator For MT5

The PChannel_System Indicator For MT5 provides 9 buffers.

SetIndexBuffer(0,Up1Buffer,INDICATOR_DATA);
SetIndexBuffer(1,Dn1Buffer,INDICATOR_DATA);
SetIndexBuffer(2,Up2Buffer,INDICATOR_DATA);
SetIndexBuffer(3,Dn2Buffer,INDICATOR_DATA);
SetIndexBuffer(4,ExtOpenBuffer,INDICATOR_DATA);
SetIndexBuffer(5,ExtHighBuffer,INDICATOR_DATA);
SetIndexBuffer(6,ExtLowBuffer,INDICATOR_DATA);
SetIndexBuffer(7,ExtCloseBuffer,INDICATOR_DATA);
SetIndexBuffer(8,ExtColorBuffer,INDICATOR_COLOR_INDEX);

Main Parts Of The Code

int OnCalculate(const int rates_total,    // number of bars in history at the current tick
                const int prev_calculated,// amount of history in bars at the previous tick
                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[])
  {
//--- checking if the number of bars is enough for the calculation
   if(rates_total lt min_rates_total) return(0);
//--- apply timeseries indexing to array elements  
   ArraySetAsSeries(open,true);
   ArraySetAsSeries(close,true);
   ArraySetAsSeries(high,true);
   ArraySetAsSeries(low,true);
//--- declaration of integer variables
   int limit;
//--- declaration of variables with a floating point  
   double HH,LL;
//--- calculations of the starting number limit for the bar recalculation loop
   if(prev_calculated gt rates_total || prev_calculated lt =0)// checking for the first start of calculation of an indicator
     {
      limit=rates_total-min_rates_total; // starting index for the calculation of all bars
     }
   else
     {
      limit=rates_total-prev_calculated; // starting index for the calculation of new bars
     }
//--- main calculation loop of the indicator
   for(int bar=limit; bar gt =0 && !IsStopped(); bar--)
     {
      HH=high[ArrayMaximum(high,bar,period)];
      LL=low[ArrayMinimum(low,bar,period)];
      Up1Buffer[bar]=HH;
      Dn1Buffer[bar]=LL;
      Up2Buffer[bar]=HH;
      Dn2Buffer[bar]=LL;
     }
//--- calculation of the starting number limit for the bar recalculation loop
   if(prev_calculated gt rates_total || prev_calculated lt =0) limit-=int(Shift);
//--- the main loop of indicator bar coloring
   for(int bar=limit; bar gt =0 && !IsStopped(); bar--)
     {
      int clr=2;
      ExtOpenBuffer[bar]=0.0;
      ExtCloseBuffer[bar]=0.0;
      ExtHighBuffer[bar]=0.0;
      ExtLowBuffer[bar]=0.0;
      //---
      if(close[bar] gt Up1Buffer[bar+Shift])
        {
         if(open[bar] lt =close[bar]) clr=4;
         else clr=3;
         ExtOpenBuffer[bar]=open[bar];
         ExtCloseBuffer[bar]=close[bar];
         ExtHighBuffer[bar]=high[bar];
         ExtLowBuffer[bar]=low[bar];
        }
      //---
      if(close[bar] lt Dn1Buffer[bar+Shift])
        {
         if(open[bar] gt close[bar]) clr=0;
         else clr=1;
         ExtOpenBuffer[bar]=open[bar];
         ExtCloseBuffer[bar]=close[bar];
         ExtHighBuffer[bar]=high[bar];
         ExtLowBuffer[bar]=low[bar];
        }
      //---
      ExtColorBuffer[bar]=clr;
     }
//---     
   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.