Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Bollinger Band PCF for identifying breaks above and below Std Dev Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
SummitTC2K
Posted : Tuesday, January 23, 2007 5:45:40 PM
Registered User
Joined: 1/4/2005
Posts: 15
I would like to know how to set up a scan on Telechart (not Snapsheets) to identify a stock when it closes above a 2 standard deviation BB; and separately, when it closes below a 2 standard BB. Thanks
Bruce_L
Posted : Tuesday, January 23, 2007 5:50:42 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
The formula would depend on the Bollinger Band settings (no Period is specified above). You may wish to review the following:

Modelling Bollinger Bands (& Standard Deviation) in a TC PCF
How to create a Personal Criteria Forumula (PCF)
Handy PCF example formulas to help you learn the syntax of PCFs!

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
SummitTC2K
Posted : Tuesday, January 23, 2007 6:04:36 PM
Registered User
Joined: 1/4/2005
Posts: 15
Hi Bruce

The period would be 20 days.
To further clarify, I would like to identify a stock when it closes above the upper band of a 2 standard deviation BB; and separately, when it closes below the lower band of a 2 standard BB. Thanks
Bruce_L
Posted : Tuesday, January 23, 2007 6:40:57 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Please try the following:

Close > Upper Bollinger Band (20,20):

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)

Close < Lower Bollinger Band (20,20):

C < AVGC20 - 2 * SQR(ABS(C ^ 2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 ^ 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) / 19)

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
SummitTC2K
Posted : Thursday, January 25, 2007 1:26:02 PM
Registered User
Joined: 1/4/2005
Posts: 15
Hi Bruce

Your BB breakout PCFs works beautifully - Thanks.

Now I would like to enhance my scans using your BB PCF by applying them to a positively or negatively sloping regression trend line over a 100 day period. Could you offer a simple PCF for a seperate positively sloping regresssion trend line (100 day period); and conversely for negatively sloping RTL. Thanks
Bruce_L
Posted : Thursday, January 25, 2007 1:42:06 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
QUOTE (SummitTC2K)
Could you offer a simple PCF for a seperate positively sloping regresssion trend line

That would depend on what you consider "simple".

(49.5 * C + 48.5 * C1 + 47.5 * C2 + 46.5 * C3 + 45.5 * C4 + 44.5 * C5 + 43.5 * C6 + 42.5 * C7 + 41.5 * C8 + 40.5 * C9 + 39.5 * C10 + 38.5 * C11 + 37.5 * C12 + 36.5 * C13 + 35.5 * C14 + 34.5 * C15 + 33.5 * C16 + 32.5 * C17 + 31.5 * C18 + 30.5 * C19 + 29.5 * C20 + 28.5 * C21 + 27.5 * C22 + 26.5 * C23 + 25.5 * C24 + 24.5 * C25 + 23.5 * C26 + 22.5 * C27 + 21.5 * C28 + 20.5 * C29 + 19.5 * C30 + 18.5 * C31 + 17.5 * C32 + 16.5 * C33 + 15.5 * C34 + 14.5 * C35 + 13.5 * C36 + 12.5 * C37 + 11.5 * C38 + 10.5 * C39 + 9.5 * C40 + 8.5 * C41 + 7.5 * C42 + 6.5 * C43 + 5.5 * C44 + 4.5 * C45 + 3.5 * C46 + 2.5 * C47 + 1.5 * C48 + .5 * C49 - .5 * C50 - 1.5 * C51 - 2.5 * C52 - 3.5 * C53 - 4.5 * C54 - 5.5 * C55 - 6.5 * C56 - 7.5 * C57 - 8.5 * C58 - 9.5 * C59 - 10.5 * C60 - 11.5 * C61 - 12.5 * C62 - 13.5 * C63 - 14.5 * C64 - 15.5 * C65 - 16.5 * C66 - 17.5 * C67 - 18.5 * C68 - 19.5 * C69 - 20.5 * C70 - 21.5 * C71 - 22.5 * C72 - 23.5 * C73 - 24.5 * C74 - 25.5 * C75 - 26.5 * C76 - 27.5 * C77 - 28.5 * C78 - 29.5 * C79 - 30.5 * C80 - 31.5 * C81 - 32.5 * C82 - 33.5 * C83 - 34.5 * C84 - 35.5 * C85 - 36.5 * C86 - 37.5 * C87 - 38.5 * C88 - 39.5 * C89 - 40.5 * C90 - 41.5 * C91 - 42.5 * C92 - 43.5 * C93 - 44.5 * C94 - 45.5 * C95 - 46.5 * C96 - 47.5 * C97 - 48.5 * C98 - 49.5 * C99) / 83325 > 0

QUOTE (SummitTC2K)
and conversely for negatively sloping RTL


(49.5 * C + 48.5 * C1 + 47.5 * C2 + 46.5 * C3 + 45.5 * C4 + 44.5 * C5 + 43.5 * C6 + 42.5 * C7 + 41.5 * C8 + 40.5 * C9 + 39.5 * C10 + 38.5 * C11 + 37.5 * C12 + 36.5 * C13 + 35.5 * C14 + 34.5 * C15 + 33.5 * C16 + 32.5 * C17 + 31.5 * C18 + 30.5 * C19 + 29.5 * C20 + 28.5 * C21 + 27.5 * C22 + 26.5 * C23 + 25.5 * C24 + 24.5 * C25 + 23.5 * C26 + 22.5 * C27 + 21.5 * C28 + 20.5 * C29 + 19.5 * C30 + 18.5 * C31 + 17.5 * C32 + 16.5 * C33 + 15.5 * C34 + 14.5 * C35 + 13.5 * C36 + 12.5 * C37 + 11.5 * C38 + 10.5 * C39 + 9.5 * C40 + 8.5 * C41 + 7.5 * C42 + 6.5 * C43 + 5.5 * C44 + 4.5 * C45 + 3.5 * C46 + 2.5 * C47 + 1.5 * C48 + .5 * C49 - .5 * C50 - 1.5 * C51 - 2.5 * C52 - 3.5 * C53 - 4.5 * C54 - 5.5 * C55 - 6.5 * C56 - 7.5 * C57 - 8.5 * C58 - 9.5 * C59 - 10.5 * C60 - 11.5 * C61 - 12.5 * C62 - 13.5 * C63 - 14.5 * C64 - 15.5 * C65 - 16.5 * C66 - 17.5 * C67 - 18.5 * C68 - 19.5 * C69 - 20.5 * C70 - 21.5 * C71 - 22.5 * C72 - 23.5 * C73 - 24.5 * C74 - 25.5 * C75 - 26.5 * C76 - 27.5 * C77 - 28.5 * C78 - 29.5 * C79 - 30.5 * C80 - 31.5 * C81 - 32.5 * C82 - 33.5 * C83 - 34.5 * C84 - 35.5 * C85 - 36.5 * C86 - 37.5 * C87 - 38.5 * C88 - 39.5 * C89 - 40.5 * C90 - 41.5 * C91 - 42.5 * C92 - 43.5 * C93 - 44.5 * C94 - 45.5 * C95 - 46.5 * C96 - 47.5 * C97 - 48.5 * C98 - 49.5 * C99) / 83325 < 0

You may wish to review the following:

Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
SummitTC2K
Posted : Friday, January 26, 2007 2:06:24 PM
Registered User
Joined: 1/4/2005
Posts: 15
Hi Bruce

Thanks for your effort on these regression trend line PCFs. They work perfectly. I must apologize for my ignorance, as I had no idea it was so complicated.

I was hoping to adapt it to different time periods (ie. 40 day) in the future when the market changes its intermediate term direction. But as I look at the complexity of your formula, I don't understand how that could easily be done (by me anyway). Is there a Sort process that could be utilized to identify or separate directional sloping RTLs from a TC2K RTL indicator or a drawn RT Line when overlaid on a chart, that can be more easily set-up to various time frames? Or can it only be done by copying and pasting from your formula in order to adapt to a change in different time frames? I don't understand the significance of the 83325 at the end of the formula, and would assume any change in time frames would require an understanding of that number, not mention everything else before it.

Thanks for your input!
Bruce_L
Posted : Friday, January 26, 2007 2:26:35 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
QUOTE (SummitTC2K)
I was hoping to adapt it to different time periods (ie. 40 day) in the future when the market changes its intermediate term direction.

Positive 40-Period Linear Regression Slope:

(19.5 * C + 18.5 * C1 + 17.5 * C2 + 16.5 * C3 + 15.5 * C4 + 14.5 * C5 + 13.5 * C6 + 12.5 * C7 + 11.5 * C8 + 10.5 * C9 + 9.5 * C10 + 8.5 * C11 + 7.5 * C12 + 6.5 * C13 + 5.5 * C14 + 4.5 * C15 + 3.5 * C16 + 2.5 * C17 + 1.5 * C18 + 0.5 * C19 - 0.5 * C20 - 1.5 * C21 - 2.5 * C22 - 3.5 * C23 - 4.5 * C24 - 5.5 * C25 - 6.5 * C26 - 7.5 * C27 - 8.5 * C28 - 9.5 * C29 - 10.5 * C30 - 11.5 * C31 - 12.5 * C32 - 13.5 * C33 - 14.5 * C34 - 15.5 * C35 - 16.5 * C36 - 17.5 * C37 - 18.5 * C38 - 19.5 * C39) / 5330 > 0

Negative 40-Period Linear Regression Slope:

(19.5 * C + 18.5 * C1 + 17.5 * C2 + 16.5 * C3 + 15.5 * C4 + 14.5 * C5 + 13.5 * C6 + 12.5 * C7 + 11.5 * C8 + 10.5 * C9 + 9.5 * C10 + 8.5 * C11 + 7.5 * C12 + 6.5 * C13 + 5.5 * C14 + 4.5 * C15 + 3.5 * C16 + 2.5 * C17 + 1.5 * C18 + 0.5 * C19 - 0.5 * C20 - 1.5 * C21 - 2.5 * C22 - 3.5 * C23 - 4.5 * C24 - 5.5 * C25 - 6.5 * C26 - 7.5 * C27 - 8.5 * C28 - 9.5 * C29 - 10.5 * C30 - 11.5 * C31 - 12.5 * C32 - 13.5 * C33 - 14.5 * C34 - 15.5 * C35 - 16.5 * C36 - 17.5 * C37 - 18.5 * C38 - 19.5 * C39) / 5330 < 0

QUOTE (SummitTC2K)
But as I look at the complexity of your formula, I don't understand how that could easily be done (by me anyway).

Did you get a chance to review the referenced topic? It explains how to construct these formulas on your own.

QUOTE (SummitTC2K)
Is there a Sort process that could be utilized to identify or separate directional sloping RTLs from a TC2K RTL indicator or a drawn RT Line when overlaid on a chart, that can be more easily set-up to various time frames?

You may wish to review the following:

Spotting trend changes using linear regression channel sorts
Comparing indicators using Visual Difference sorts
Sorting price and indicators by their Actual Value
Sort using envelopes, regression channels and Bollinger bands
Learn to quickly identify when price and volume are in or out of step
Using Linear Regression Sorts to Help Spot Divergences

QUOTE (SummitTC2K)
I don't understand the significance of the 83325 at the end of the formula, and would assume any change in time frames would require an understanding of that number, not mention everything else before it.

You actually don't need to know how to calculate this number or even use it in the above formulas because dividing a number by a positive number doesn't change the sign.

That said, I included it because you do need it if you want to calculate the actual slope of the Linear Regression. When using the form described in the reference on how to write these types of formulas, you can calculate this denominator by summing the squares of the factors for each term. Let's take the formula for a 5-Period Linear Regression Slope as an example:

(1.5 * C + 0.5 * C1 - 0.5 * C2 - 1.5 * C3) / 5

+1.5 ^ 2 = 2.25
+0.5 ^ 2 = 0.25
-0.5 ^ 2 = 0.25
-1.5 ^ 2 = 2.25

2.25 + 0.25 + 0.25 + 2.25 = 5

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
SummitTC2K
Posted : Thursday, February 1, 2007 5:12:05 PM
Registered User
Joined: 1/4/2005
Posts: 15
Hi Bruce

Thanks for your RT Slope PCFs. While I did review the referenced topic and formulas, I have to admit I didn't fully grasp the nuances. The links to sorts using envelopes, regression channels, and BBs was very enlightening and easier to adapt to my needs - Thanks.

As I play with these concepts to try and develop a refined scan, I'm trying to tweek your 1/23/07 response to my original BB outside close PCF. You offered a X (above & below) BB from which I'm trying to restructure to tell me when it crosses back and closes under the upper BB after a previous close above the upper band. I don't think it's quite correct, but if you would review it, I would appreciate it.

Close xDown Upper Bollinger Band (20,20):

C1 => AVGC20.1 + 2 * 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 - 20 * AVGC20.1 ^ 2) / 19) AND C < AVGC20 + 2 * 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 ^ 2) / 19)

And for when it crosses back and closes above the lower BB after a previous close below the lower band. I believe I'm missing something here as well.

Close xUp Lower Bollinger Band (20,20):

C1 <= AVGC20.1 - 2 * 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 - 20 * AVGC20.1 ^ 2) / 19) AND C > AVGC20 - 2 * 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 ^ 2) / 19)


Thanks for your help!
Bruce_L
Posted : Thursday, February 1, 2007 5:34:15 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
The only difference between an Upper Bollinger Band formula and a Lower Bollinger Band formula is that the Upper Bollinger Band formula has a plus sign (+) between the Moving Average and the Standard Deviation while the Lower Bollinger Band formula has a minus sign (-) between the Moving Average and the Standard Deviation.

So converting the Close xUp Upper Bollinger Band to a Close xUp Lower Bollinger Band formula is simply a matter of changing two characters:

Close xUp Lower Bollinger Band (20,20):

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) AND C1 <= AVGC20.1 - 2 * 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) / 19)

The same applies for converting the Close xDown Lower Bollinger Band formula to a Close xDown Upper Bollinger Band formula:

Close xDown Upper Bollinger Band (20,20):

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) AND C1 >= AVGC20.1 + 2 * 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) / 19)

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.