Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 10/13/2011 Posts: 10
|
I'm completely new to writing formulas but from the reading I've done, I can't find a way to make an indicator for %B times bandwidth.
Is this possible, please?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
It would depend on the settings of your Bollinger %B and Bollinger Bandwidth Indicators, but if both are set to 20,2.0, the formula could be written as:
((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) / 20) / 4 + .5) * 4 * 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) / 20) / AVGC20
Modelling Bollinger Bands (& Standard Deviation) in a TC 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: 10/13/2011 Posts: 10
|
Great service, thank you very much Bruce!
|
|
Registered User Joined: 4/4/2010 Posts: 2
|
QUOTE (Bruce_L) It would depend on the settings of your Bollinger %B and Bollinger Bandwidth Indicators, but if both are set to 20,2.0, the formula could be written as:
((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) / 20) / 4 + .5) * 4 * 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) / 20) / AVGC20
Modelling Bollinger Bands (& Standard Deviation) in a TC PCF
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!
When I tired to use the above PCF for MSFT the test gave me a 0.03 result instead of a 0.75 reading as indicated by the TC2000 %B 20 2 indicator. Have I misapplied the PCF?
Rick S
|
|
Registered User Joined: 4/4/2010 Posts: 2
|
I am incorrect (missed a set of "()" in the formula). In the end I used:
(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) / 20))) / (4 * 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) / 20))
I wanted to get this one right, as I intend to use adaptations of the PCF to calculate previous %B values.
Regret inconvenience.
Rick S
|
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
Rick,
You can use copy/paste with a posted PCF.
Just use: "Ctrl V" to paste it into telechart.
Thanks
diceman
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
It is not missing any parentheses. It should be noted that this is a formula for Bollinger %B 20,2 times Bollinger Bandwidth 20,2. A formula for just the Bollinger %B 20,2 would be:
((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) / 20) / 4 + .5)
While a formula for just the Bollinger Bandwidth 20,2 would be:
4 * 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) / 20) / AVGC20
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |