Risk warning

All articles, strategies and indicators are just reflecting a single traders opinion and should be viewed as that.
I advice everybody to trade with a DEMO account!

Tuesday, February 22, 2011

Bollinger Percent B

The percent bollinger band is a derivate of John Bollinger's original Bollinger Bands indicator.  Basically it indicates how close the price is to the upper and lower band.

close to 100 means close to the upper band
above 100 means above the upper band (= outside the bands)
close to 0 means close to the lower band
under 0 means below the lower band (= outside the bands)


The code for the new version of dealbook or prostation:

indicator PercentBBS;
/*written by ctlprogrammer*/
/*you can freely copy the code but plz leave this header*/
/*http://ctltrading.blogspot.com*/
input period = 20,deviation=2;
draw line1("Percent_BBS");
begin
integer f := front(close);
integer b := back(close);
bollinger_bands(close,period,deviation);
for f:=1 to b do
begin
line1[f] :=((Close[f] - Bollinger_Bands.line_lower[f]) / (Bollinger_Bands.line_upper[f] - Bollinger_Bands.line_lower[f]))*100;
end;
end.

The code for the older version of dealbook or prostation:

indicator PercentBBS;
/*written by ctlprogrammer*/
/*you can freely copy the code but plz leave this header*/
/*http://ctltrading.blogspot.com*/
input period = 20,deviation=2;
draw line1("Percent_BBS");
vars f(number),b(number);
begin
f := front(close);
b := back(close);
bollinger_bands(close,period,deviation);
for f:=1 to b do
begin
line1[f] :=((Close[f] - Bollinger_Bands.line_lower[f]) / (Bollinger_Bands.line_upper[f] - Bollinger_Bands.line_lower[f]))*100;
end;
end.

2 comments:

  1. Hello CTLprogrammer,
    Is it possible to write code from Bollinger Percent B in the old version.

    K.r.

    Albert

    ReplyDelete
  2. Sure no problem i added it to the post.

    Take care.

    ReplyDelete