Custom Formula Collection

Relative Strength Index, Custom (RSI)

This custom RSI will allow you to select which price data to use when you plot it. The standard RSI uses the close value as Welles Wilder did when he created the indicator. This custom indicator will allow you to use the other price fields including volume.

Q:=Input("Time Periods",1,1000,14);

B:=Input("Field: 1=Close, 2=Open, 3=High, 4=Low, 5=Volume",1,5,1);

Z:=If(B=1,Wilders(If(ROC(C,1,$)>0,ROC(C,1,$),0),LastValue(Q)),If(B=2,Wilders(If(ROC(O,1,$)>0,ROC(O,1,$),0),LastValue(Q)),If(B=3,Wilders(If(ROC(H,1,$)>0,ROC(H,1,$),0),LastValue(Q)),If(B=4,Wilders(If(ROC(L,1,$)>0,ROC(L,1,$),0),LastValue(Q)),Wilders(If(ROC(V,1,$)>0,ROC(V,1,$),0),LastValue(Q))))));

Y:=If(B=1,Wilders(If(ROC(C,1,$)<0,Abs(ROC(C,1,$)),0),LastValue(Q)),If(B=2,Wilders(If(ROC(O,1,$)<0,Abs(ROC(O,1,$)),0),LastValue(Q)),If(B=3,Wilders(If(ROC(H,1,$)<0,Abs(ROC(H,1,$)),0),LastValue(Q)),If(B=4,Wilders(If(ROC(L,1,$)<0,Abs(ROC(L,1,$)),0),LastValue(Q)),Wilders(If(ROC(V,1,$)<0,Abs(ROC(V,1,$)),0),LastValue(Q))))));

RS:=Z/Y;

100-(100/(1+RS))

For additional help with formulas, please see the Formula Primer.

Can't find the custom formula you need? MetaStock can create formulas for you.