| Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 12/1/2004 Posts: 137
|
Hi Bruce,
Could you pls help me with writing a PCF for the following:
A formula which represents the Lower Band of my Linear Regression Line (Period 50, Extension 0, Width 30) and ZOOM 6.
What I'm trying to do is to be able to then write a simple PCF for my Closing Price to be between 95% to 102% of the above mentioned Lower Band Line of my Lin Reg Line.
Also, I notice that when I press the Period Key on my template, I get a "Lin Reg" Value along with values for my other indicators. What is the relationship between the value of my lower band line and the Lin Reg (center line) value?
In other words, can the value of the Lower Band line of my Linear Regression line be also calculated based on that Lin Reg value? I am using Zoom 6 and is that dependent on my ZOOM?
Thks
chopee
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The calculations are not dependendent on Zoom. The Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis explains the calculations of the right end point of the centerline of a Linear Regression Line while the Linear regression channel calculations explores the width of the Linear Regression Channels and the calculations of the right end points of the Upper and Lower Bands.
Price at or above 95% and at or below 102% of the Lower LR Line:
ABS(C / (AVGC50 + 24.5 * (24.5 * C + 23.5 * C1 + 22.5 * C2 + 21.5 * C3 + 20.5 * C4 + 19.5 * C5 + 18.5 * C6 + 17.5 * C7 + 16.5 * C8 + 15.5 * C9 + 14.5 * C10 + 13.5 * C11 + 12.5 * C12 + 11.5 * C13 + 10.5 * C14 + 9.5 * C15 + 8.5 * C16 + 7.5 * C17 + 6.5 * C18 + 5.5 * C19 + 4.5 * C20 + 3.5 * C21 + 2.5 * C22 + 1.5 * C23 + .5 * C24 - .5 * C25 - 1.5 * C26 - 2.5 * C27 - 3.5 * C28 - 4.5 * C29 - 5.5 * C30 - 6.5 * C31 - 7.5 * C32 - 8.5 * C33 - 9.5 * C34 - 10.5 * C35 - 11.5 * C36 - 12.5 * C37 - 13.5 * C38 - 14.5 * C39 - 15.5 * C40 - 16.5 * C41 - 17.5 * C42 - 18.5 * C43 - 19.5 * C44 - 20.5 * C45 - 21.5 * C46 - 22.5 * C47 - 23.5 * C48 - 24.5 * C49) / 10412.5 - 30 * (ABS(C48 - AVGC2.48) + ABS(C47 - AVGC3.47) + ABS(C46 - AVGC4.46) + ABS(C45 - AVGC5.45) + ABS(C44 - AVGC6.44) + ABS(C43 - AVGC7.43) + ABS(C42 - AVGC8.42) + ABS(C41 - AVGC9.41) + ABS(C40 - AVGC10.40) + ABS(C39 - AVGC11.39) + ABS(C38 - AVGC12.38) + ABS(C37 - AVGC13.37) + ABS(C36 - AVGC14.36) + ABS(C35 - AVGC15.35) + ABS(C34 - AVGC16.34) + ABS(C33 - AVGC17.33) + ABS(C32 - AVGC18.32) + ABS(C31 - AVGC19.31) + ABS(C30 - AVGC20.30) + ABS(C29 - AVGC21.29) + ABS(C28 - AVGC22.28) + ABS(C27 - AVGC23.27) + ABS(C26 - AVGC24.26) + ABS(C25 - AVGC25.25) + ABS(C24 - AVGC26.24) + ABS(C23 - AVGC27.23) + ABS(C22 - AVGC28.22) + ABS(C21 - AVGC29.21) + ABS(C20 - AVGC30.20) + ABS(C19 - AVGC31.19) + ABS(C18 - AVGC32.18) + ABS(C17 - AVGC33.17) + ABS(C16 - AVGC34.16) + ABS(C15 - AVGC35.15) + ABS(C14 - AVGC36.14) + ABS(C13 - AVGC37.13) + ABS(C12 - AVGC38.12) + ABS(C11 - AVGC39.11) + ABS(C10 - AVGC40.10) + ABS(C9 - AVGC41.9) + ABS(C8 - AVGC42.8) + ABS(C7 - AVGC43.7) + ABS(C6 - AVGC44.6) + ABS(C5 - AVGC45.5) + ABS(C4 - AVGC46.4) + ABS(C3 - AVGC47.3) + ABS(C2 - AVGC48.2) + ABS(C1 - AVGC49.1) + ABS(C - AVGC50)) / 1000) - .985) <= .035
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/1/2004 Posts: 137
|
Thks Bruce. Is the formula you've provided me the Value of the Lower Regression Line Band?
I tested your formula by writing another PCF where:
C>0.95*(Your Formula in parenthesis) AND C<=1.02*(Your Formula in parenthesis) - My objective is to uncover stocks whose closing price is 95% to 102% of the Lower Regression Line Value.
When I plugged that into an Easy Scan (using All Items in the System), I got NO Stocks! It's highly unlikely that this is the case. So, could you please advise me on what I might be doing wrong?
Thks
chopee
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
No. The formula provided was not designed to return a Value. The formula provided is a Boolean (True or False) formula to test for Price to be between 95% to 102% of the Lower Linear Regression Band (at or above 5% below and at or below 2% above the Lower LR Line). The technique you propose for checking for this would appear to be far less efficient as it needs to calculate the Lower Bollinger Band twice instead of once.
The formula for the Lower Bollinger Band itself is:
AVGC50 + 24.5 * (24.5 * C + 23.5 * C1 + 22.5 * C2 + 21.5 * C3 + 20.5 * C4 + 19.5 * C5 + 18.5 * C6 + 17.5 * C7 + 16.5 * C8 + 15.5 * C9 + 14.5 * C10 + 13.5 * C11 + 12.5 * C12 + 11.5 * C13 + 10.5 * C14 + 9.5 * C15 + 8.5 * C16 + 7.5 * C17 + 6.5 * C18 + 5.5 * C19 + 4.5 * C20 + 3.5 * C21 + 2.5 * C22 + 1.5 * C23 + .5 * C24 - .5 * C25 - 1.5 * C26 - 2.5 * C27 - 3.5 * C28 - 4.5 * C29 - 5.5 * C30 - 6.5 * C31 - 7.5 * C32 - 8.5 * C33 - 9.5 * C34 - 10.5 * C35 - 11.5 * C36 - 12.5 * C37 - 13.5 * C38 - 14.5 * C39 - 15.5 * C40 - 16.5 * C41 - 17.5 * C42 - 18.5 * C43 - 19.5 * C44 - 20.5 * C45 - 21.5 * C46 - 22.5 * C47 - 23.5 * C48 - 24.5 * C49) / 10412.5 - 30 * (ABS(C48 - AVGC2.48) + ABS(C47 - AVGC3.47) + ABS(C46 - AVGC4.46) + ABS(C45 - AVGC5.45) + ABS(C44 - AVGC6.44) + ABS(C43 - AVGC7.43) + ABS(C42 - AVGC8.42) + ABS(C41 - AVGC9.41) + ABS(C40 - AVGC10.40) + ABS(C39 - AVGC11.39) + ABS(C38 - AVGC12.38) + ABS(C37 - AVGC13.37) + ABS(C36 - AVGC14.36) + ABS(C35 - AVGC15.35) + ABS(C34 - AVGC16.34) + ABS(C33 - AVGC17.33) + ABS(C32 - AVGC18.32) + ABS(C31 - AVGC19.31) + ABS(C30 - AVGC20.30) + ABS(C29 - AVGC21.29) + ABS(C28 - AVGC22.28) + ABS(C27 - AVGC23.27) + ABS(C26 - AVGC24.26) + ABS(C25 - AVGC25.25) + ABS(C24 - AVGC26.24) + ABS(C23 - AVGC27.23) + ABS(C22 - AVGC28.22) + ABS(C21 - AVGC29.21) + ABS(C20 - AVGC30.20) + ABS(C19 - AVGC31.19) + ABS(C18 - AVGC32.18) + ABS(C17 - AVGC33.17) + ABS(C16 - AVGC34.16) + ABS(C15 - AVGC35.15) + ABS(C14 - AVGC36.14) + ABS(C13 - AVGC37.13) + ABS(C12 - AVGC38.12) + ABS(C11 - AVGC39.11) + ABS(C10 - AVGC40.10) + ABS(C9 - AVGC41.9) + ABS(C8 - AVGC42.8) + ABS(C7 - AVGC43.7) + ABS(C6 - AVGC44.6) + ABS(C5 - AVGC45.5) + ABS(C4 - AVGC46.4) + ABS(C3 - AVGC47.3) + ABS(C2 - AVGC48.2) + ABS(C1 - AVGC49.1) + ABS(C - AVGC50)) / 1000
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/1/2004 Posts: 137
|
Bruce,
If my objective in an Easy Scan is to uncovers stocks whose price is between 95% and 102% of the Lower Regression Lines Lower Bandvalue, How do I incorporate that into an Easy Scan.
I've plugged in your original PCF formula into my Scan Condition and it returned ZERO Stocks. Could you pls advise? What do I need to do to achieve my objective stated above? I need to be able to visually see that those stocks uncovered are actually closing between 95 and 102% of my lower regression line's lower band
thks
Chopee
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
An EasyScan using the original Personal Criteria Formula provided as its only EasyScan Conditions returns 539 symbols when based on the All Stocks Watchlist using 9/22/2009 Market Close data. Are you sure you aren't still multiplying it by .95 or .102 and making some sort of camparison as you were doing in your first attempt? If you have changed the formula from your first attempt, have you updated your PCFs so the changes can be reflected in your EasyScan results?
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/1/2004 Posts: 137
|
Bruce,
I have now used All Items in the system and haven't changed your original formula. When I scroll through the 539 stocks, they don't visually appear to be right. The closing price should visually show that it's pretty close to the Lower Regression line but they don't. You've said that this is independent of Zoom. Could there be some other reason?
chopee
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Can you provide some specific example symbols?
It should be noted that the percentages are based on the value of the Lower Linear Regression Line and that there is no reason that the range of 95% to 102% of the Lower Linear Regression could not be quite wide when compared to the price range being Plotted on the Chart or to the width of the Linear Regression Channel. We could base these percentages on the price range being Plotted on the Chart (knowing the Zoom) or on the width of the Linear Regression Channel (without knowing the Zoom), but this is not what was requested.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/1/2004 Posts: 137
|
Bruce,
I checked up on another formula which you gave me some time ago which was "Price at or below Lower Regression Line". I've now incorporated that and the results seem more in line with what I'm looking for. So, for now, let me go with that.
Thks for your help
chopee
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 3/16/2005 Posts: 15
|
Looking at Writing a PCF for the Lower Band of my Linear Regression Line and having a Linear Regression Line (Period 50, Extension10, Width 25) used your suggested formula for the Lower Bollinger Band. 622 items came up today 9/23/2009. VZ was one, but ELN did not. Looking at ELN chart it looks as if the price is right on the lower boundary at 7.25. which would put it in the range of 95% to 102% of the above mentioned Lower Band Line of my Lin Reg Line. Why didn't ELN get selected as T
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
jmr66,
Your settings aren't the same. You have an extension of 10 and a width of 25 instead of an extension of 0 and a width of 30. You would need a different formula to reflect your difference in settings.
ABS(C / (AVGC50.10 + 34.5 * (24.5 * C10 + 23.5 * C11 + 22.5 * C12 + 21.5 * C13 + 20.5 * C14 + 19.5 * C15 + 18.5 * C16 + 17.5 * C17 + 16.5 * C18 + 15.5 * C19 + 14.5 * C20 + 13.5 * C21 + 12.5 * C22 + 11.5 * C23 + 10.5 * C24 + 9.5 * C25 + 8.5 * C26 + 7.5 * C27 + 6.5 * C28 + 5.5 * C29 + 4.5 * C30 + 3.5 * C31 + 2.5 * C32 + 1.5 * C33 + .5 * C34 - .5 * C35 - 1.5 * C36 - 2.5 * C37 - 3.5 * C38 - 4.5 * C39 - 5.5 * C40 - 6.5 * C41 - 7.5 * C42 - 8.5 * C43 - 9.5 * C44 - 10.5 * C45 - 11.5 * C46 - 12.5 * C47 - 13.5 * C48 - 14.5 * C49 - 15.5 * C50 - 16.5 * C51 - 17.5 * C52 - 18.5 * C53 - 19.5 * C54 - 20.5 * C55 - 21.5 * C56 - 22.5 * C57 - 23.5 * C58 - 24.5 * C59) / 10412.5 - 25 * (ABS(C58 - AVGC2.58) + ABS(C57 - AVGC3.57) + ABS(C56 - AVGC4.56) + ABS(C55 - AVGC5.55) + ABS(C54 - AVGC6.54) + ABS(C53 - AVGC7.53) + ABS(C52 - AVGC8.52) + ABS(C51 - AVGC9.51) + ABS(C50 - AVGC10.50) + ABS(C49 - AVGC11.49) + ABS(C48 - AVGC12.48) + ABS(C47 - AVGC13.47) + ABS(C46 - AVGC14.46) + ABS(C45 - AVGC15.45) + ABS(C44 - AVGC16.44) + ABS(C43 - AVGC17.43) + ABS(C42 - AVGC18.42) + ABS(C41 - AVGC19.41) + ABS(C40 - AVGC20.40) + ABS(C39 - AVGC21.39) + ABS(C38 - AVGC22.38) + ABS(C37 - AVGC23.37) + ABS(C36 - AVGC24.36) + ABS(C35 - AVGC25.35) + ABS(C34 - AVGC26.34) + ABS(C33 - AVGC27.33) + ABS(C32 - AVGC28.32) + ABS(C31 - AVGC29.31) + ABS(C30 - AVGC30.30) + ABS(C29 - AVGC31.29) + ABS(C28 - AVGC32.28) + ABS(C27 - AVGC33.27) + ABS(C26 - AVGC34.26) + ABS(C25 - AVGC35.25) + ABS(C24 - AVGC36.24) + ABS(C23 - AVGC37.23) + ABS(C22 - AVGC38.22) + ABS(C21 - AVGC39.21) + ABS(C20 - AVGC40.20) + ABS(C19 - AVGC41.19) + ABS(C18 - AVGC42.18) + ABS(C17 - AVGC43.17) + ABS(C16 - AVGC44.16) + ABS(C15 - AVGC45.15) + ABS(C14 - AVGC46.14) + ABS(C13 - AVGC47.13) + ABS(C12 - AVGC48.12) + ABS(C11 - AVGC49.11) + ABS(C10 - AVGC50.10)) / 1000) - .985) <= .035
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 3/16/2005 Posts: 15
|
Looks good now. 1289 hits now and ELN is among them.
Thanks for the help.
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
jmr66,
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
|
Guest-1 |