Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 4/7/2011 Posts: 69
|
Hi Bruce,
Do you have any formula to get the value for today's top and bottom bollinger band values (Period 20, st. dev 2).
thanks!
Martin
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
An Indicator Formula for the Simple Upper Bollinger Band 20, 2.00 could be written as:
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)
And an Indicator Formula for the Simple Lower Bollinger Band 20, 2.00 could be written as:
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)
Modelling Bollinger Bands (& Standard Deviation) in a TC PCF
That said, it is usually just easier to click on the Bollinger Bands and select Create Scan Condition or Show value in WatchList than to create a formula.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/7/2011 Posts: 69
|
Thanks Bruce, That is just what I needed!
|
|
Registered User Joined: 12/10/2010 Posts: 2
|
Bruce, I would like to know if a formula is possible to write (H1-L1) / (Yesterdays high BB-Yesterdays low BB) with the answer able to be put in a colum as a % ?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If the Bollinger Bands are the same Simple Bollinger Bands 20, 2.00 used above, then an Indicator Formula for this could be written as:
100 * (H1 - L1) / (4 * SQR(ABS(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 + C20 ^ 2 - 20 * AVGC20.1 ^ 2) / 20))
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 2/27/2011 Posts: 3
|
Bruce, thanks for your BB code on 1/31/13. But it seems that you just repeated the upper BB code and did not give the code for the lower BB. You wrote:
An Indicator Formula for the Simple Upper Bollinger Band 20, 2.00 could be written as:
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)
And an Indicator Formula for the Simple Lower Bollinger Band 20, 2.00 could be written as:
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)
Would you please post the code for the lower BB?
NOTE: as far as I can tell one could not create a scan using the chart system for a stock opening above an upper BB and closing below it. So it seems a PCFs would be needed.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The second formula was not a repeat of the first formula and it produces different results (they were both labeled as Upper however). The first formula has a + after AVGC20 and the second formula has a - after AVGC20.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |