Registered User Joined: 12/21/2008 Posts: 8
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The formula for Bollinger %b depends on the Period and Width of the Bollinger Band for which it is being calculated. The following represents a Bollinger %b 20,20 where the Lower BB is 0 and the Upper BB is 100:
100 * (C - AVGC20) / SQR(ABS(C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2 - 20 * AVGC20 ^ 2) / 19) / 4 + 50
You may wish to review the following:
Modelling Bollinger Bands (& Standard Deviation) in a TC PCF
How to create a Personal Criteria Forumula (PCF)
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 12/21/2008 Posts: 8
|
How would you write the PCF so that it would give stocks that pierce the lower BB rather than the upper one?
Thanks
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The formula given isn't Boolean, it just returns where it is in the bands (so if the result is less than 0, it is below the Lower BB). You could write a Personal Criteria Formula for Price being below the Lower Bollinger Band 20,20 as:
C < AVGC20 - 2 * SQR(ABS(C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2 - 20 * AVGC20 ^ 2) / 19)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|