PCR Indicator For MT5
The PCR Indicator For MT5 is a super amazing tool that lets you know the percentage of retracement when the price starts going against the major trend. Most of the time the traders don’t know how to find the end of the retracement. But this tool can tell you about the retracement endpoint by utilization of the overbought and oversold conditions of the market. If the market starts dropping in an uptrend, you need to find the indicator curve near the 20 mark, which states the market is already in the oversold state. Similarly, look for the curve near the 80 marks, when the price starts to rally near the critical resistance level. While using this tool, you must learn to limit the risk factors in each trade or else it will be tough to manage the losses.
Installing the PCR 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 PCR.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 PCR Indicator For MT5
The PCR Indicator For MT5 has 3 parameters to configure.
input uint InpPeriod = 10; // Period
input double InpOverbought = 80.0; // Overbought
input double InpOversold = 20.0; // Oversold
Buffers of the PCR Indicator For MT5
The PCR Indicator For MT5 provides 1 buffers.
SetIndexBuffer(0,BufferPCR,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[])
{
//--- #AB0= gt 2:0 lt 0AA82 gt 2 1CD5@ gt 2 :0: B09 lt A5@89
ArraySetAsSeries(high,true);
ArraySetAsSeries(low,true);
ArraySetAsSeries(close,true);
//--- @ gt 25@:0 8 @0AGQB : gt ;8G5AB20 ?@ gt AG8BK205 lt KE 10@ gt 2
if(rates_total lt fmax(period,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(BufferPCR,EMPTY_VALUE);
}
//--- 0AGQB 8=48:0B gt @0
for(int i=limit; i gt =0 && !IsStopped(); i--)
{
int bl=Lowest(period,i);
int bh=Highest(period,i);
if(bl==WRONG_VALUE || bh==WRONG_VALUE)
continue;
double min=low[bl];
double max=high[bh];
BufferPCR[i]=(max!=min ? 100.0*(1.0-(max-close[i])/(max-min)) : 0);
}
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
//| gt 72@0I05B 8=45:A lt 0:A8 lt 0;L= gt 3 gt 7=0G5=8O B09 lt A5@88 High |
//+------------------------------------------------------------------+
int Highest(const int count,const int start)
{
double array[];
ArraySetAsSeries(array,true);
return(CopyHigh(Symbol(),PERIOD_CURRENT,start,count,array)==count ? ArrayMaximum(array)+start : WRONG_VALUE);
}
//+------------------------------------------------------------------+
//| gt 72@0I05B 8=45:A lt 8=8 lt 0;L= gt 3 gt 7=0G5=8O B09 lt A5@88 Low |
//+------------------------------------------------------------------+
int Lowest(const int count,const int start)
{
double array[];
ArraySetAsSeries(array,true);
return(CopyLow(Symbol(),PERIOD_CURRENT,start,count,array)==count ? ArrayMinimum(array)+start : WRONG_VALUE);
}
//+------------------------------------------------------------------+