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 |

PCF - Slope Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
ChampionCoach
Posted : Tuesday, September 27, 2011 7:20:44 PM
Registered User
Joined: 3/20/2011
Posts: 25
Please help me. I have made lots of PCFs to give me what I need to monitor for my scans.
Your Program's Conditions and Indicators are fantastic!  I can do whatever I can conceive it seems.

However, I am having trouble converting Conditions created within a chart to PCFs for Columnar searching.

Is there a PCF that will give me the slope of a Chart's Linear Regression line? For example, I place a 20-day Linear Regression Line on a chart. Now I want to find all stocks whose Linear Regression lines have the same or nearly-the-same slopes.

Is there an Indicator PCF that will give me the slope of a Chart's Linear Regression line?

Thanks for all that you do to help us get the most out of using your program!
Bruce_L
Posted : Wednesday, September 28, 2011 9:05:04 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
If you want to make comparisons between symbols, you might want to use something similar to the following:

100 * (19 * (C - C19) + 17 * (C1 - C18) + 15 * (C2 - C17) + 13 * (C3 - C16) + 11 * (C4 - C15) + 9 * (C5 - C14) + 7 * (C6 - C13) + 5 * (C7 - C12) + 3 * (C8 - C11) + C9 - C10) / 1330 / AVGC20

It is the 20-Period Linear Regression Slope expressed as a percentage of the 20-Period Simple Moving Average.

Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
cdj001
Posted : Sunday, November 20, 2011 6:13:28 PM
Registered User
Joined: 10/28/2011
Posts: 4
Hi Bruce, I am new here. Can you explain a bit on how come the "1330" in the formula above? and how about a 50-day linear regression line slope be expressed as an indicator PCF?
Thanks!
Bruce_L
Posted : Monday, November 21, 2011 8:54:04 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Check out bustermu's Tuesday, April 04, 2006 12:12:34 PM ET post in the previously referenced Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis topic for a detailed explanation of the 1330 used in the denominator. I actually doubled the factors used in both the numerator and denominator to get the factors in the numerator as integers to shorten the formula slightly.

A straight up 50-Period Linear Regression Slope formula could be written as:

(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

And shortened slightly using the same technique to:

(49 * (C - C49) + 47 * (C1 - C48) + 45 * (C2 - C47) + 43 * (C3 - C46) + 41 * (C4 - C45) + 39 * (C5 - C44) + 37 * (C6 - C43) + 35 * (C7 - C42) + 33 * (C8 - C41) + 31 * (C9 - C40) + 29 * (C10 - C39) + 27 * (C11 - C38) + 25 * (C12 - C37) + 23 * (C13 - C36) + 21 * (C14 - C35) + 19 * (C15 - C34) + 17 * (C16 - C33) + 15 * (C17 - C32) + 13 * (C18 - C31) + 11 * (C19 - C30) + 9 * (C20 - C29) + 7 * (C21 - C28) + 5 * (C22 - C27) + 3 * (C23 - C26) + C24 - C25) / 20825

Expressing the slope as a percentage of the 50-Period Simple Moving Average so it can be compared between symbols would result in:

100 * (49 * (C - C49) + 47 * (C1 - C48) + 45 * (C2 - C47) + 43 * (C3 - C46) + 41 * (C4 - C45) + 39 * (C5 - C44) + 37 * (C6 - C43) + 35 * (C7 - C42) + 33 * (C8 - C41) + 31 * (C9 - C40) + 29 * (C10 - C39) + 27 * (C11 - C38) + 25 * (C12 - C37) + 23 * (C13 - C36) + 21 * (C14 - C35) + 19 * (C15 - C34) + 17 * (C16 - C33) + 15 * (C17 - C32) + 13 * (C18 - C31) + 11 * (C19 - C30) + 9 * (C20 - C29) + 7 * (C21 - C28) + 5 * (C22 - C27) + 3 * (C23 - C26) + C24 - C25) / 20825 / AVGC50

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
cdj001
Posted : Tuesday, November 22, 2011 11:21:39 AM
Registered User
Joined: 10/28/2011
Posts: 4
Thanks, Bruce!
Bruce_L
Posted : Tuesday, November 22, 2011 11:23:12 AM


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.