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 |

Lower Bollinger pierce Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
fredmacc
Posted : Sunday, June 24, 2012 9:24:39 PM
Registered User
Joined: 11/1/2010
Posts: 28

Hi Bruce L.

I searched and found a formula for a close below the lower Bollinger band and found a formula you submitted from a while ago.  I took your formula and modified it to pertain to the Bollinger band 15, 1.5.

Can you check whether I've got it set correctly?

C < AVGC15 - 1.5 * 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 - 15 * AVGC15 ^ 1.5) / 14)

Thanks,

fredmacc

Bruce_L
Posted : Monday, June 25, 2012 9:01:45 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You did great.

Your formula would be absolutely correct in TC2000 version 7 which uses the sample standard deviation. TC2000 version 12 uses the population standard deviation in its calculations however would would change the / 14 at the end of the Condition Formula into a / 15 instead.

C < AVGC15 - 1.5 * 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 - 15 * AVGC15 ^ 2) / 15)

The difference is rather small for large periods but can be significant for shorter periods.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
fredmacc
Posted : Monday, June 25, 2012 9:22:49 PM
Registered User
Joined: 11/1/2010
Posts: 28

Thanks for your help Bruce.

fredmacc
Posted : Wednesday, June 27, 2012 7:41:38 PM
Registered User
Joined: 11/1/2010
Posts: 28

Hello Bruce L

My goal was to be able to run the scan we've been talking about and have it return stocks that are piercing the lower Bollinger band.  When I run the scan on the US Stocks or All Stocks no stocks are returned.  I'm not sure if I've made a typographical error or not.  I'll copy the formula here to see if you can spot the problem.  I found that if I take out the condition referring to price 3 stocks are returned KV-A, DEXO, and XATA.  These are penny stocks.  When I add a price condition like price gt 10 nothing is returned.  I know there are stocks with price above 10 dollars that are piercing the lower Bollinger band but the Easy scan does not return them.  I'm not sure if I need an "and" statement or if the order of the separate conditions is important.  Please have a look.

Thanks,

Fred

C < AVGC15 - 1.5 * 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 - 15 * AVGC15 ^ 1.5) / 14)

C >= 15

fredmacc
Posted : Wednesday, June 27, 2012 7:56:13 PM
Registered User
Joined: 11/1/2010
Posts: 28

QUOTE (fredmacc)

Hello Bruce L

My goal was to be able to run the scan we've been talking about and have it return stocks that are piercing the lower Bollinger band.  When I run the scan on the US Stocks or All Stocks no stocks are returned.  I'm not sure if I've made a typographical error or not.  I'll copy the formula here to see if you can spot the problem.  I found that if I take out the condition referring to price 3 stocks are returned KV-A, DEXO, and XATA.  These are penny stocks.  When I add a price condition like price gt 10 nothing is returned.  I know there are stocks with price above 10 dollars that are piercing the lower Bollinger band but the Easy scan does not return them.  I'm not sure if I need an "and" statement or if the order of the separate conditions is important.  Please have a look.  I also tried the formula as C >= 15 and C < AVGC15 - 1.5 * 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 - 15 * AVGC15 ^ 1.5) / 14) that didn't work either.

Thanks,

Fred

C < AVGC15 - 1.5 * 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 - 15 * AVGC15 ^ 1.5) / 14)

C >= 15

Bruce_L
Posted : Thursday, June 28, 2012 8:40:32 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Two issues.

I somehow missed that you raised AVGC15 to the power of 1.5 instead of to the power of 2.

And as you noted, you need to have an AND between the two formula components.

So you probably want:

C < AVGC15 - 1.5 * 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 - 15 * AVGC15 ^ 2) / 15) AND C >= 15



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
fredmacc
Posted : Thursday, June 28, 2012 9:03:31 AM
Registered User
Joined: 11/1/2010
Posts: 28

Hi Bruce,

I made the change you selected and still have no stocks returned by the scan.

Fred

Bruce_L
Posted : Thursday, June 28, 2012 9:11:42 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I get 433 items returned currently for the All US Stocks WatchList.

Did you remove and re-add the Condition Formula to the EasyScan after you changed it? Adjusting a Condition Formula after it as added to an EasyScan will not change the EasyScan.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
fredmacc
Posted : Thursday, June 28, 2012 9:23:19 AM
Registered User
Joined: 11/1/2010
Posts: 28

Bruce,

It worked. I don't get same number returned but I'll work on that.

Thanks,

Fred

Bruce_L
Posted : Thursday, June 28, 2012 9:31:50 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

All US Stocks is a Personal WatchList which I created. If I use the US Common Stocks WatchList I get 271 items.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
fredmacc
Posted : Thursday, June 28, 2012 3:46:16 PM
Registered User
Joined: 11/1/2010
Posts: 28

Bruce thanks again for all your help.

Fred

fredmacc
Posted : Thursday, June 28, 2012 3:48:25 PM
Registered User
Joined: 11/1/2010
Posts: 28

Yes I get a larger number especially if I use All items in system which I imported from TC2007.

Thanks,

Fred

fredmacc
Posted : Thursday, June 28, 2012 8:47:14 PM
Registered User
Joined: 11/1/2010
Posts: 28

Bruce,  I would like to be able to modify the search to locate stocks that pierce the upper bollinger band.  I've tried turning the first > symbol around but that didn't do it.  I still see stocks with lower

bollinger band piercing.  Some  stocks are returned with upper band pierce though.  Can you show me how to get it to work?

Thanks,

Fred

Bruce_L
Posted : Thursday, June 28, 2012 10:09:13 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You have to change the < to a > and the - to a +. So you probably want:

C > AVGC15 + 1.5 * 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 - 15 * AVGC15 ^ 2) / 15) AND C >= 15



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
fredmacc
Posted : Friday, June 29, 2012 6:18:41 PM
Registered User
Joined: 11/1/2010
Posts: 28

Bruce thanks for the help.

Fred

deepshub
Posted : Sunday, September 9, 2012 4:11:13 PM
Registered User
Joined: 9/20/2005
Posts: 18

Bruce I have written the PCF to give stocks that have any one of the OHLC being below the Bollinger Band Period 15 and StdDev 1.5 as follows.

O <= AVGC15 - 1.5 * 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  - 15 * AVGC15 ^ 2) / 15)
OR
H <= AVGC15 - 1.5 * 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  - 15 * AVGC15 ^ 2) / 15)
OR
L <= AVGC15 - 1.5 * 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  - 15 * AVGC15 ^ 2) / 15)
OR
C <= AVGC15 - 1.5 * 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  - 15 * AVGC15 ^ 2) / 15)

Results are not accurate and also can you please check because the Lower value of BB being provided in TC2000 Ver 12 Beta as the scan running on Daily SP-500 does not quite give the right result.

Thanks for your help

 

deepshub
Posted : Sunday, September 9, 2012 4:18:05 PM
Registered User
Joined: 9/20/2005
Posts: 18

Further to my post of Sept 09 3:11:13 pm .....

What I am looking for is the close to be above the Bollinger Band Period 15 and StdDev 1.5, while the O or L any one of these two prices to be possibly under the Lower BB , since if the C is within the BB then by default the H will be within the BB as well even in cases where C=H.

Thanks

 

deepshub
Posted : Sunday, September 9, 2012 4:34:42 PM
Registered User
Joined: 9/20/2005
Posts: 18

Hello Bruce:

Wrote this PCF further to my post Sept 9 3:18:05 pm - Still results not accurate..Please review for Lower Bollinger Band Period 15 and Std Dev 1.5 - Daily on SP-500 watchlist

(O <= AVGC15 - 1.5 * 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  - 15 * AVGC15 ^ 2) / 15)
OR
L <= AVGC15 - 1.5 * 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  - 15 * AVGC15 ^ 2) / 15))
AND
C >= AVGC15 - 1.5 * 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  - 15 * AVGC15 ^ 2) / 15)

 

Thanks

Bruce_L
Posted : Monday, September 10, 2012 10:37:03 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

QUOTE (deepshub)
What I am looking for is the close to be above the Bollinger Band Period 15 and StdDev 1.5, while the O or L any one of these two prices to be possibly under the Lower BB , since if the C is within the BB then by default the H will be within the BB as well even in cases where C=H.

You can use the same optimization for the O and L as L <= O. This means you could use:

C > AVGC15 - 1.5 * 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 - 15 * AVGC15 ^ 2) / 15) AND L < AVGC15 - 1.5 * 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 - 15 * AVGC15 ^ 2) / 15)

I haven't found any discrepencies, so if you are still experiencing issues, please provide some specific symbols as examples.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
deepshub
Posted : Monday, September 10, 2012 11:31:21 AM
Registered User
Joined: 9/20/2005
Posts: 18

Hello Bruce:

Take a look at the following at Sept 10 10:29CT on a 10 minute chart for discrepencies using PCF as suggested in your post Sept 10 9:37:03 am above.

CRUS - Low 42.42 Lower BB 42.33 but showed up in Live Results.

Thanks

 

Bruce_L
Posted : Monday, September 10, 2012 11:42:23 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

The Low of the Septembeer 10, 2012 11:30 AM ET 10-Minute Bar for CRUS is 42.42, but the Lower Bollinger Band is 42.51 (not 42.33) for a Bollinger Band with the following settings (the settings for which the formula was created):

- Period: 15
- Std Dev: 1.50
- Average Type: Simple

What are your Bollinger Band settings?



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
deepshub
Posted : Monday, September 10, 2012 11:47:34 AM
Registered User
Joined: 9/20/2005
Posts: 18

My mistake : Settings are Period: 15 Std Dev 1.5 Average Type: Exponential.  How can we change the PCF to reflect Exponential and/or Front Weighted MA's

Thanks

Bruce_L
Posted : Monday, September 10, 2012 11:56:31 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Changing the formula to reflect an Exponential Bollinger Band is relatively simple as Exponential Moving Averages are built into the Personal Criteria Formula Language:

C > XAVGC15 - 1.5 * 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 - 15 * AVGC15 ^ 2) / 15) AND L < XAVGC15 - 1.5 * 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 - 15 * AVGC15 ^ 2) / 15)

Changing the formula to reflect a Front Weighted Bollinger band is a bit more complicated:

C > (15 * C + 14 * C1 + 13 * C2 + 12 * C3 + 11 * C4 + 10 * C5 + 9 * C6 + 8 * C7 + 7 * C8 + 6 * C9 + 5 * C10 + 4 * C11 + 3 * C12 + 2 * C13 + C14) / 120 - 1.5 * 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 - 15 * AVGC15 ^ 2) / 15) AND L < (15 * C + 14 * C1 + 13 * C2 + 12 * C3 + 11 * C4 + 10 * C5 + 9 * C6 + 8 * C7 + 7 * C8 + 6 * C9 + 5 * C10 + 4 * C11 + 3 * C12 + 2 * C13 + C14) / 120 - 1.5 * 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 - 15 * AVGC15 ^ 2) / 15)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
deepshub
Posted : Monday, September 10, 2012 12:22:49 PM
Registered User
Joined: 9/20/2005
Posts: 18

Thanks a million Bruce..You are the best ..

 

Deepak

Bruce_L
Posted : Monday, September 10, 2012 12:28:00 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome.



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