Indicator RSI retracement levels

 

Hi, I wish to add 2 lines showing a % retracement from highest high and lowest low on the standard RSI.
I added commands in red to the code, but it wont compile. I am stuck. Thanks in advance for your help.

#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_buffers 5
#property indicator_color1 DodgerBlue
//---- input parameters
extern int RSIPeriod=14;
extern int TrailStopPercent=20;
//---- buffers
double RSIBuffer[];
double PosBuffer[];
double NegBuffer[];
double Highest_RSI[];
double Lowest_RSI[];
double LongTrailBuffer[];
double ShortTrailBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- additional buffers are used for counting.
IndicatorBuffers(5);
SetIndexBuffer(0,RSIBuffer);
SetIndexBuffer(1,PosBuffer);
SetIndexBuffer(2,NegBuffer);
SetIndexBuffer(3,LongTrailBuffer);
SetIndexBuffer(4,ShortTrailBuffer);

//---- indicator line
SetIndexStyle(0,DRAW_LINE);
//---- trail lines
SetIndexStyle(3,DRAW_LINE);
SetIndexStyle(4,DRAW_LINE);

//---- name for DataWindow and indicator subwindow label
short_name="RSI("+RSIPeriod+")";
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);
//----
SetIndexDrawBegin(0,RSIPeriod);
SetIndexDrawBegin(3,RSIPeriod);
SetIndexDrawBegin(4,RSIPeriod);

//----
return(0);
}
//+------------------------------------------------------------------+
//| Relative Strength Index |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted();
double rel,negative,positive;
//----
if(Bars<=RSIPeriod) return(0);
//---- initial zero
if(counted_bars<1)
for(i=1;i<=RSIPeriod;i++) RSIBuffer[Bars-i]=0.0;
//----
i=Bars-RSIPeriod-1;
if(counted_bars>=RSIPeriod) i=Bars-counted_bars-1;
while(i>=0)
{
double sumn=0.0,sump=0.0;
if(i==Bars-RSIPeriod-1)
{
int k=Bars-2;
//---- initial accumulation
while(k>=i)
{
rel=Close[k]-Close[k+1];
if(rel>0) sump+=rel;
else sumn-=rel;
k--;
}
positive=sump/RSIPeriod;
negative=sumn/RSIPeriod;
}
else
{
//---- smoothed moving average
rel=Close[i]-Close[i+1];
if(rel>0) sump=rel;
else sumn=-rel;
positive=(PosBuffer[i+1]*(RSIPeriod-1)+sump)/RSIPeriod;
negative=(NegBuffer[i+1]*(RSIPeriod-1)+sumn)/RSIPeriod;
}
PosBuffer[i]=positive;
NegBuffer[i]=negative;
if(negative==0.0) RSIBuffer[i]=0.0;
else RSIBuffer[i]=100.0-100.0/(1+positive/negative);
i--;
//---- trail stop lines
Highest_RSI = MathMax(Highest_RSI,iRSI(NULL,0,RSIPeriod,Close,i));
Lowest_RSI = MathMin(Lowest_RSI,iRSI(NULL,0,RSIPeriod,Close,i));
LongTrailBuffer = Highest_RSI - Highest_RSI * (TrailStopPercent/100);
ShortTrailBuffer = Lowest_RSI + Lowest_RSI * (TrailStopPercent/100);
}
return(0);
}

Reason: