PFE2 Indicator For MT5

PFE2 Indicator For MT5

The PFE2 Indicator For MT5 has no specific Author or yet to be discovered. The indicator analyzes the current trend and represents the market state with a smooth oscillator calculation. But the readings are created in colored bars. The light green bars with an accessing curve is the starting of the uptrend.

The trend is strongest then the reading is above 70 levels. But the buyers start to lose control of this market after the color changes to light blue. The traders usually prepare them for a strong bearish correction after the size of the bar starts to decrease. On the contrary, the color of the bars will be light crimson during the downtrend.

If it falls below the -70, it is a strong sign of a downtrend. But the sellers will start to show weakness when the bar changes its color to purple. It is another sign of an oversold market. Being an active day trader, this coloration signal bars can act as a great trade filter tool. However, compressing the reading with the candlestick pattern trading method can improve the efficiency of filtering the bad trades.

FREE PFE2 Indicator

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

The PFE2 Indicator For MT5 has 1 parameters to configure.

input uint Length=7; //smoothing depth

Buffers of the PFE2 Indicator For MT5

The PFE2 Indicator For MT5 provides 2 buffers.


Main Parts Of The Code

int OnCalculate(
                const int rates_total,     // amount of history in bars at the current tick
                const int prev_calculated, // amount of history in bars at the previous tick
                const int begin,           // number of beginning of reliable counting of bars
                const double &price[]      // price array for calculation of the indicatorà
//---- Checking if the number of bars is sufficient for the calculation
   if(rates_total lt min_rates_total+begin) return(0);

///---- declaration of local variables 
   int first,bar;
   double PFE,c2c,fraceff,dSMA,res;
   static int min_rates;
//---- calculation of the starting number first 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
      first=min_rates;  // starting number for calculation of all bars
      //---- increase the position of the beginning of data by  begin  bars as a result of calculation using data of another indicator
      if(begin gt 0) PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,min_rates_total+begin);
   else first=prev_calculated-1; // starting number for calculation of new bars

//---- Main calculation loop of the indicator
   for(bar=first; bar lt rates_total; bar++)

      for(int rrr=1; rrr lt 10; rrr++) c2c+=MathSqrt(MathPow(SMA[Count[rrr+1]]-SMA[Count[rrr]],2)+1);
      if(!c2c) c2c=1.0*_Point;

      PFE = MathSqrt(MathPow(dSMA,2)+100);

      if(dSMA gt 0) fraceff=MathRound(+res);
      else  fraceff=MathRound(-res);

      if(bar gt min_rates) IndBuffer[bar]=MathRound((fraceff*0.333)+(IndBuffer[bar-1]*(1-0.333))); 
      else IndBuffer[bar]=fraceff;

      if(bar lt rates_total-1) Recount_ArrayZeroPos(Count,size);

   if(prev_calculated gt rates_total || prev_calculated lt =0) first++;
//---- Main indicator coloring loop
   for(bar=first; bar lt rates_total; bar++)
      if(IndBuffer[bar] gt 0)
         if(IndBuffer[bar] gt IndBuffer[bar-1]) ColorIndBuffer[bar]=5;
         if(IndBuffer[bar]==IndBuffer[bar-1]) ColorIndBuffer[bar]=4;
         if(IndBuffer[bar] lt IndBuffer[bar-1]) ColorIndBuffer[bar]=3;

      if(IndBuffer[bar] lt 0)
         if(IndBuffer[bar] lt IndBuffer[bar-1]) ColorIndBuffer[bar]=0;
         if(IndBuffer[bar]==IndBuffer[bar-1]) ColorIndBuffer[bar]=1;
         if(IndBuffer[bar] gt IndBuffer[bar-1]) ColorIndBuffer[bar]=2;


About Me

I'm Mike Semlitsch the owner of 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.