BBTrend

A forum for all EdgeRater users

Moderator: Chris White

Post Reply
ian_uk
Posts: 6
Joined: Mon Dec 09, 2013 3:45 pm

BBTrend

Post by ian_uk »

I am trying to create in Edgerater an indicator based on John Bollinger's BBTrend. I am not able to compile the following initial attempt (the parameter defaults will be 20 for N, 2 for P and 50 for Q. Posted below it is reference to Mr Bollinger's code.

MID := MA (CLOSE, N);
UPPERST := MID + P*STDP (CLOSE, N);
LOWERST := MID - P*STDP (CLOSE, N);
UPPERLT := MID + P*STDP (CLOSE, Q);
LOWERST := MID - P*STDP (CLOSE, Q);
UPPER := ABS (UPPERST-UPPERLT);
LOWER := ABS (LOWERST-LOWERLT);
BBTrend := (LOWER-UPPER)/MID;

Hi Chris

Forgive me if this is already included in your superb software, but I think it would be very interesting to be able to have BBTrend as an indicator and scanable in the software. It is referred to in the last page of his TASC interview of 2102 and which also has a very nice reference to Ian Woodward. Mr Bollinger has revealed the code (see below)

It seems a very useful addition to the Bollinger Band analysis comparing the momentum of shorter term to longer term Bollinger Bands with above or below zero determining the trend and also turns in the oscillator possibly pointing to reversals.

Best regards

Ian

http://www.bollingerbands.com/bbandsfor ... 0bca191318

bands

Joined: 31 Dec 1969
Posts: 33

PostPosted: Tue Mar 11, 2014 1:04 pm Post subject: Reply with quote
BBTrend is calculated from two sets of Bollinger Bands, typically 20 period and 50 period.

Code:
lower = abs(lowerBB(20) - lowerBB(50))
upper = abs(upperBB(20) - upperBB(50))
BBTrend = (lower - upper) / middleBB(20)

Hope that helps,

John Bollinger
Chris White
Posts: 201
Joined: Mon Nov 29, 2010 9:21 pm

Re: BBTrend

Post by Chris White »

Hi Ian,

The code you provided will not compile because LOWERLT has not been defined. I'm guessing you have a typo in that the second declaration of LOWERST should be LOWERLT, which would make your code look like this which does compile:

Code: Select all

MID := MA (CLOSE, N);
UPPERST := MID + P*STDP (CLOSE, N);
LOWERST := MID - P*STDP (CLOSE, N);
UPPERLT := MID + P*STDP (CLOSE, Q);
LOWERLT := MID - P*STDP (CLOSE, Q);
UPPER := ABS (UPPERST-UPPERLT);
LOWER := ABS (LOWERST-LOWERLT);
BBTrend : (LOWER-UPPER)/MID;
But I think there might be a problem with the formula because by this definition BBTrend will always be 0 because the distance between the short and long term upper BBs will always be the same as the distance between the short and long term lower BBs, so LOWER-UPPER will always be 0.

Chris.
Chris White
Posts: 201
Joined: Mon Nov 29, 2010 9:21 pm

Re: BBTrend

Post by Chris White »

This code should be better, it uses the Long Term mid band for the Long Term bollinger bands and therefore doesn't result in a BBTrend value of 0

Code: Select all

MIDST := MA (CLOSE, N);
MIDLT := MA (CLOSE, Q);
UPPERST := MIDST + P*STDP (CLOSE, N);
LOWERST := MIDST - P*STDP (CLOSE, N);
UPPERLT := MIDLT + P*STDP (CLOSE, Q);
LOWERLT := MIDLT - P*STDP (CLOSE, Q);
UPPER := ABS (UPPERST-UPPERLT);
LOWER := ABS (LOWERST-LOWERLT);
BBTrend : (LOWER-UPPER)/MIDST;
ian_uk
Posts: 6
Joined: Mon Dec 09, 2013 3:45 pm

Re: BBTrend

Post by ian_uk »

Many thanks Chris that is very useful. I was interested when I saw John demonstrate the reversal of the indicator on TWTR in his recent video (at 40:00). It was my first attempt to use edgerater code and I appreciate your help. John's video is on youtube at

https://www.youtube.com/watch?v=puxK4e_2yPc

Best regards

Ian
Post Reply