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
BBTrend
Moderator: Chris White
-
- Posts: 212
- Joined: Mon Nov 29, 2010 9:21 pm
Re: BBTrend
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:
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.
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;
Chris.
-
- Posts: 212
- Joined: Mon Nov 29, 2010 9:21 pm
Re: BBTrend
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;
Re: BBTrend
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
https://www.youtube.com/watch?v=puxK4e_2yPc
Best regards
Ian