%b - Bollinger Bands Percent

Interested in sharing a snippet of code? A nice chart? Want to show off your great multi-system, or get feedback on one you're considering? Here you can share your creations with others.

%b - Bollinger Bands Percent

Postby sratastearch » Fri Jul 10, 2015 10:32 am

Hi - I've gotten a lot of help and learned a lot in the process of using StrataSearch. Just thought I'd share %b entry syntax for anyone who is interested in Bollinger by percent. Obviously, you'd use the period and standard deviations useful to you. I don't claim anything I share is correct, so review as needed.

The calculation is:
%B = (Price - Lower Band)/(Upper Band - Lower Band)

The calculation, in SS code:
(close - bbl(close,20,2.5)) / (bbu(close,20,2.5) - bbl(close,20,2.5))

To express that %b is below 0:
(close - bbl(close,20,2.5)) / (bbu(close,20,2.5) - bbl(close,20,2.5)) < 0

To say that %b was below zero 1 day ago:
ref((close - bbl(close,20,2.5)) / (bbu(close,20,2.5) - bbl(close,20,2.5)), -1) < 0
sratastearch
 
Posts: 7
Joined: Fri Mar 20, 2015 11:50 am

Return to Shared Area