Help with code/indicator...

 
Hello:

I found this code for a Mt4 StocRSI Indicator, but I don't know how to put it all together to make the indicator. Could someone take a look and see if they can help. Here's the code along with the Website URL where I found the code:

(http://www.xeatrade.com/trading/8/S/109.html)




/*[[
Name := Stoch RSI
Author := Luis Damiani
Separate Window := Yes
First Color := lime
First Draw Type := Line
First Symbol := 217
Use Second Data :=yes
Second Color := RoyalBlue
Second Draw Type := Line
Second Symbol := 218
]]*/

Input : D1RSIPer(13), D2StochPer(8),stcrsismooth(3),signsmooth(4),num_bars(150);
Variable : shift(0),shift2(0),rsi(0),maxrsi(0),minrsi(0),storsi(0),E3D(0);
Variable:sig1(0),sig2(0),ss1(0),ss2(0),sk(0),sk2(0),sig1n(0),sig2n(0);
Variable : init(true);
Variables : bar(0), prevbars(0), start(0), cs(0), prevcs(0),commodt("nonono"),frame(0);

cs= D1RSIPer+D2StochPer+stcrsismooth+signsmooth+num_bars; //checksum used to see if parameters have been changed
if cs=prevcs and (commodt=symbol)and frame=t[4]-t[5] and bars-prevbars<2 then
start=Bars-prevbars //params haven't changed only need to calculate new bar
else start=-1;
commodt=symbol;
frame=t[4]-t[5];
prevbars = Bars;
prevcs = cs;
if (start=1 | start=0) then bar=start else init = true;

if init then
{

if stcrsismooth<1 then ss1=1 else ss1=stcrsismooth;
sk = 2 / (ss1 + 1);
if signsmooth<2 then ss2=2 else ss2=signsmooth;
sk2=2/(ss2+1);
bar=num_bars;
init=false;
};

SetLoopCount(0);
For shift = bar Downto 0 Begin
rsi=iRSI(D1RSIPer,shift);
maxrsi=rsi;
minrsi=rsi;

for shift2= shift+D2StochPer downto shift {
rsi=iRSI(D1RSIPer,shift2);
maxrsi=max(rsi,maxrsi);
minrsi=min(rsi,minrsi);
}

storsi=((rsi-minrsi)/(maxrsi-minrsi)*200-100);
//E3D=hot*icci(D3tunnelPer,shift)+(1-hot)*storsi;
sig1n=sk*storsi+(1-sk)*sig1;
sig2n= sk2*sig1+(1-sk2)*sig2;
//print(shift);
if (start=1 and shift=1) or start=-1 then {sig1=sig1n;sig2=sig2n;}
SetIndexValue(shift,sig1n);
SetIndexValue2(shift,sig2n);
End;
Reason: