Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

PCF: Close outside of Bollinger Bands (20,2) Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
willharperllc
Posted : Wednesday, February 9, 2011 12:45:39 AM
Registered User
Joined: 11/29/2009
Posts: 1
I am new to telechart's PCF stuff and was trying to figure out a way to scan for stocks that are coming out of a volatility squeeze, more specifcally that have a "closing price outside of one of the bollinger bands." Can anyone help me with this?

Also, what about a PCF for the "Narrowest the bollinger bands have been in the past 6 months" as a way to scan for stocks. Any idea about this one.

I really appreciate the help. Can't wait until I know how to do this on my own. Thanks again.

-Will
Bruce_L
Posted : Wednesday, February 9, 2011 9:24:29 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Welcome to the forums. A very good foundation for learning how to use TeleChart can be gained by reviewing the following:

If you are new to TeleChart READ THIS FIRST!

One way to write a Personal Criteria Formula for Price being outside the Bollinger Bands 20,20 in the current version of TeleChart is:

Modelling Bollinger Bands (& Standard Deviation) in a TC PCF
How to create a Personal Criteria Forumula (PCF)
PCF Formula Descriptions

ABS(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)

If you want Price to be crossing out of the bands, you would also need to check for Price being inside the bands during the previous Bar:

ABS(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 ABS(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)

I do not know of a way to write a PCF for the Bollinger Bands being at their narrowest point in the most recent six months in the current version of TeleChart.

All questions, comments and suggestions related to the TC2000.com version 11 beta should be addressed to:

feedback@tc2000.com

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
bert953
Posted : Thursday, May 5, 2011 12:23:36 PM
Registered User
Joined: 5/3/2007
Posts: 10
What would I change in the formula to look for 3 std deviations instead of 2?

ABS(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_L
Posted : Thursday, May 5, 2011 12:25:58 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Change the every instance of 2 * to 3 * instead:

ABS(C - AVGC20) > 3 * 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
munney_dummy
Posted : Saturday, December 3, 2011 9:48:55 AM
Registered User
Joined: 8/28/2011
Posts: 3
For price crossing out of the bands (pasted here from Bruce L's post):

ABS(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 ABS(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)

I am getting mismatched parenthesis error.  Can you see where to correct?  Thanks.
munney_dummy
Posted : Saturday, December 3, 2011 9:55:37 AM
Registered User
Joined: 8/28/2011
Posts: 3
Okay, I think I got it.  For those wanting to use the above formula, just past the AND there is a "ABS(C1 - AVGC20.1" that requires a perenthesis after it.
munney_dummy
Posted : Saturday, December 3, 2011 10:02:57 AM
Registered User
Joined: 8/28/2011
Posts: 3
Sorry for the repeated posts in the same thread but I am working my way through this step by step.  I now have an indicator that flags a candlestick outside the BB, following a bar inside the bands.  If I want to add a condition that the next bar be inside the bands how would I change it?

In other words, the indicator I want to code is: a day within BB, followed by a day crossing out and finally with a day where open and close are both within the bands again.

Thanks for the help.
Bruce_L
Posted : Monday, December 5, 2011 10:50:44 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You mention a day within the BB, a day crossing out and a day within the Bollinger Bands as well as "...where the open and close are both within...".  The formula given are based entirely on the close. Are you interested  in the open and close requirement for all days? Do you care where the ligh and low are relative to the Bollinger Bands?

Are you using TC2000 version 12 or TC2000 version 7?

-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.