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
|
|
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
|
|
Registered User Joined: 11/1/2010 Posts: 28
|
Thanks for your help Bruce.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
Registered User Joined: 11/1/2010 Posts: 28
|
Bruce thanks again for all your help.
Fred
|
|
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
|
|
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
|
|
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
|
|
Registered User Joined: 11/1/2010 Posts: 28
|
Bruce thanks for the help.
Fred
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
Registered User Joined: 9/20/2005 Posts: 18
|
Thanks a million Bruce..You are the best ..
Deepak
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |