MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

 A B C D E F G H I J K L M N O P R S T U V W Y Z #

RSI Bands by Francois Bertrand
Francois Bertrand’s in April 2008 TASC article, “RSI Bands” describes the calculation and use of these bands.

RSI Bands

topv:=Input("overbought level",1,100,70);
botv:=Input("oversold level",1,100,30);
tp:=Input("RSI Time Periods",1,100,14);
change:= ROC(C,1,\$);
Z:=Wilders(If(change>0,change,0),tp);
Y:=Wilders(If(change<0,Abs(change),0),tp);
tx:=(tp-1)*(Y*topv/(100-topv)-Z);
bx:=(tp-1)*(Y*botv/(100-botv)-Z);
tband:=If(tx>0,C+tx,C+tx*(100-topv)/topv);
bband:=If(bx>0,C+bx,C+bx*(100-botv)/botv);
tband;
bband

The article also make reference to using “clamping” when the number volatility caused the bands to widen beyond a usable range. Here is the same indicator with the option to enable clamping at a variable range:

RSI Bands with Clamping

topv:=Input("overbought level",1,100,70);
botv:=Input("oversold level",1,100,30);
tp:=Input("RSI Time Periods",1,100,14);
clamp:=Input("use clamping 1=Yes/0=No",0,1,0);
cper:= Input("clamping percent",5,50,10);
change:= ROC(C,1,\$);
Z:=Wilders(If(change>0,change,0),tp);
Y:=Wilders(If(change<0,Abs(change),0),tp);
tx:=(tp-1)*(Y*topv/(100-topv)-Z);
bx:=(tp-1)*(Y*botv/(100-botv)-Z);
tb1:=If(tx>0,C+tx,C+tx*(100-topv)/topv);
bb1:=If(bx>0,C+bx,C+bx*(100-botv)/botv);
tband:=If(clamp=1 AND tb1>C*(1+cper/100),C*(1+cper/100),tb1);
bband:=If(clamp=1 AND bb1<C*(1-cper/100),C*(1-cper/100),bb1);
tband;
bband

--William Golson
Equis International
www.equis.com
Source / From: TOP
http://www.equis.com

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.