Percentage of Trend Indicator For MT5

Percentage of Trend Indicator For MT5

The Percentage of Trend Indicator For MT5 is one of the most delicate tools that is mostly used by professional traders. The indicator value is calculated based on the open, high, close and low of the market. Most of the time it becomes impossible for the retail traders to find the starting point of the market retracement by analyzing the minor support and resistance level. But this indicator can make your trading process much easier and allow you to earn more money. When the blue bars are formed above the +80 mark, you should be looking to sell the trading asset. However, if the value of the red bars must touch the -80 mark or else you should not consider the market to be in the overbought state. You can use the simple observation process to find the oversold condition of the asset. Though getting reading of this indicator is a little bit confusing, you can learn its use properly by using a demo account.

FREE Percentage of Trend Indicator

Download the FREE Percentage of Trend 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 Percentage of Trend 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 percentageoftrend.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 Percentage of Trend Indicator For MT5

The Percentage of Trend Indicator For MT5 has 2 parameters to configure.

input int InpPeriod1=20;  // Period1
input int InpPeriod2=100; // Period2

Buffers of the Percentage of Trend Indicator For MT5

The Percentage of Trend Indicator For MT5 provides 2 buffers.

SetIndexBuffer(0,Period1Buffer,INDICATOR_DATA);
SetIndexBuffer(1,Period2Buffer,INDICATOR_DATA);

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 max=MathMax(InpPeriod1,InpPeriod2);
   int pos;
   int bars=Bars(_Symbol,_Period);
   if(bars lt max) return(0);
   if(prev_calculated gt max) pos=prev_calculated;
   else pos = max;
   for(int i=pos; i lt rates_total;i++)
     {
      double   HighValue1= 0;
      double   LowValue1 = 0;

      for(int cnt=i-InpPeriod1+1; cnt lt i+1;cnt++)
        {
         if(high[cnt] gt HighValue1) HighValue1=high[cnt];
        }

      for(int cnt=i-InpPeriod1+1; cnt lt i+1;cnt++)
        {
         if(cnt==i-InpPeriod1+1) LowValue1=low[cnt];
         if(low[cnt] lt LowValue1) LowValue1=low[cnt];
        }

      double   HighValue2= 0;
      double   LowValue2 = 0;

      for(int cnt=i-InpPeriod2+1; cnt lt i+1;cnt++)
        {
         if(high[cnt] gt HighValue2) HighValue2=high[cnt];
        }

      for(int cnt=i-InpPeriod2+1; cnt lt i+1;cnt++)
        {
         if(cnt==i-InpPeriod2+1) LowValue2=low[cnt];
         if(low[cnt] lt LowValue2) LowValue2=low[cnt];
        }

      Period1Buffer[i] = (close[i] - LowValue1) / (HighValue1 - LowValue1);
      Period2Buffer[i] = (close[i] - LowValue2)*-1 / (HighValue2 - LowValue2);

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