Linear regression slope & r-squared for four Fibonacci periods Rate this Topic:
 Previous Topic · Next Topic Watch this topic · Print this topic ·
Putt4Dough
 Posted : Friday, June 29, 2012 7:51:05 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

## Please see the Linear Regression and Linear Regression Slope and R-Squared (R^2) topics for improved syntax in TC2000 v17+.

Hi Bruce,

I'm putting together a TC2000 Workspace related to linear regression analysis, and when you have some time I could use PCFs for the following...

5-period Linear Regression Slope
5-period R-Squared

8-period Linear Regression Slope
8-period R-Squared

13-period Linear Regression Slope
13-period R-Squared

21-period Linear Regression Slope
21-period R-Squared

Thank you!

Bruce_L
 Posted : Friday, June 29, 2012 8:59:20 AM

Worden Trainer

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

QUOTE (Putt4Dough)
5-period Linear Regression Slope

(2 * C + C1 - C3 - 2 * C4) / 10

QUOTE (Putt4Dough)
5-period R-Squared

(((5 - 1) / 2 * AVGC5 - (C1 + 2 * C2 + 3 * C3 + 4 * C4) / 5) / SQR((5 ^ 2 - 1) / 12 * ((C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2) / 5 - AVGC5 ^ 2))) ^ 2

QUOTE (Putt4Dough)
8-period Linear Regression Slope

(3.5 * C + 2.5 * C1 + 1.5 * C2 + .5 * C3 - .5 * C4 - 1.5 * C5 - 2.5 * C6 - 3.5 * C7) / 42

QUOTE (Putt4Dough)
8-period R-Squared

(((8 - 1) / 2 * AVGC8 - (C1 + 2 * C2 + 3 * C3 + 4 * C4 + 5 * C5 + 6 * C6 + 7 * C7) / 8) / SQR((8 ^ 2 - 1) / 12 * ((C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2) / 8 - AVGC8 ^ 2))) ^ 2

QUOTE (Putt4Dough)
13-period Linear Regression Slope

(6 * C + 5 * C1 + 4 * C2 + 3 * C3 + 2 * C4 + C5 - C7 - 2 * C8 - 3 * C9 - 4 * C10 - 5 * C11 - 6 * C12) / 182

QUOTE (Putt4Dough)
13-period R-Squared

(((13 - 1) / 2 * AVGC13 - (C1 + 2 * C2 + 3 * C3 + 4 * C4 + 5 * C5 + 6 * C6 + 7 * C7 + 8 * C8 + 9 * C9 + 10 * C10 + 11 * C11 + 12 * C12) / 13) / SQR((13 ^ 2 - 1) / 12 * ((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) / 13 - AVGC13 ^ 2))) ^ 2

QUOTE (Putt4Dough)
21-period Linear Regression Slope

(10 * C + 9 * C1 + 8 * C2 + 7 * C3 + 6 * C4 + 5 * C5 + 4 * C6 + 3 * C7 + 2 * C8 + C9 - C11 - 2 * C12 - 3 * C13 - 4 * C14 - 5 * C15 - 6 * C16 - 7 * C17 - 8 * C18 - 9 * C19 - 10 * C20) / 770

QUOTE (Putt4Dough)
21-period R-Squared

(((21 - 1) / 2 * AVGC21 - (C1 + 2 * C2 + 3 * C3 + 4 * C4 + 5 * C5 + 6 * C6 + 7 * C7 + 8 * C8 + 9 * C9 + 10 * C10 + 11 * C11 + 12 * C12 + 13 * C13 + 14 * C14 + 15 * C15 + 16 * C16 + 17 * C17 + 18 * C18 + 19 * C19 + 20 * C20) / 21) / SQR((21 ^ 2 - 1) / 12 * ((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 + C20 ^ 2) / 21 - AVGC21 ^ 2))) ^ 2

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
 Posted : Friday, June 29, 2012 9:10:45 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

Awesome, Bruce. Have a great weekend!

Putt4Dough
 Posted : Wednesday, August 1, 2012 2:53:24 PM

Registered User
Joined: 7/30/2007
Posts: 1,072

Hi Bruce,

With your previous help my Linear Regression workspace is coming along nicely. Can I trouble you for the Linear Regression Slope & R-Squared PCFs for the next two Fibonacci's?

34-period Linear Regression Slope
34-period R-Squared

55-period Linear Regression Slope
55-period R-Squared

Thanks!

Bruce_L
 Posted : Wednesday, August 1, 2012 3:08:00 PM

Worden Trainer

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

A 34-Period Linear Regression Slope could be written as:

(16.5 * C + 15.5 * C1 + 14.5 * C2 + 13.5 * C3 + 12.5 * C4 + 11.5 * C5 + 10.5 * C6 + 9.5 * C7 + 8.5 * C8 + 7.5 * C9 + 6.5 * C10 + 5.5 * C11 + 4.5 * C12 + 3.5 * C13 + 2.5 * C14 + 1.5 * C15 + 0.5 * C16 - 0.5 * C17 - 1.5 * C18 - 2.5 * C19 - 3.5 * C20 - 4.5 * C21 - 5.5 * C22 - 6.5 * C23 - 7.5 * C24 - 8.5 * C25 - 9.5 * C26 - 10.5 * C27 - 11.5 * C28 - 12.5 * C29 - 13.5 * C30 - 14.5 * C31 - 15.5 * C32 - 16.5 * C33) / 3272.5

A 34-Period R-Squared could be written as:

((((34 - 1) / 2) * AVGC34 - (C1 +2*C2 +3*C3 +4*C4 +5*C5 +6*C6 +7*C7 +8*C8 +9*C9 +10*C10 +11*C11 +12*C12 +13*C13 +14*C14 +15*C15 +16*C16 +17*C17 +18*C18 +19*C19 +20*C20 +21*C21 +22*C22 +23*C23 +24*C24 +25*C25 +26*C26 +27*C27 +28*C28 +29*C29 +30*C30 +31*C31 +32*C32 +33*C33) / 34) / SQR(((34^2 - 1) / 12) * ((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 +C20^2 +C21^2 +C22^2 +C23^2 +C24^2 +C25^2 +C26^2 +C27^2 +C28^2 +C29^2 +C30^2 +C31^2 +C32^2 +C33^2) / 34 - AVGC34^2)))^2

A 55-Period Linear Regression Slope could be written as:

(27 * C + 26 * C1 + 25 * C2 + 24 * C3 + 23 * C4 + 22 * C5 + 21 * C6 + 20 * C7 + 19 * C8 + 18 * C9 + 17 * C10 + 16 * C11 + 15 * C12 + 14 * C13 + 13 * C14 + 12 * C15 + 11 * C16 + 10 * C17 + 9 * C18 + 8 * C19 + 7 * C20 + 6 * C21 + 5 * C22 + 4 * C23 + 3 * C24 + 2 * C25 + C26 - C28 - 2 * C29 - 3 * C30 - 4 * C31 - 5 * C32 - 6 * C33 - 7 * C34 - 8 * C35 - 9 * C36 - 10 * C37 - 11 * C38 - 12 * C39 - 13 * C40 - 14 * C41 - 15 * C42 - 16 * C43 - 17 * C44 - 18 * C45 - 19 * C46 - 20 * C47 - 21 * C48 - 22 * C49 - 23 * C50 - 24 * C51 - 25 * C52 - 26 * C53 - 27 * C54) / 13860

A 55-Period R-Squared could be written as:

((((55 - 1) / 2) * AVGC55 - (C1 +2*C2 +3*C3 +4*C4 +5*C5 +6*C6 +7*C7 +8*C8 +9*C9 +10*C10 +11*C11 +12*C12 +13*C13 +14*C14 +15*C15 +16*C16 +17*C17 +18*C18 +19*C19 +20*C20 +21*C21 +22*C22 +23*C23 +24*C24 +25*C25 +26*C26 +27*C27 +28*C28 +29*C29 +30*C30 +31*C31 +32*C32 +33*C33 +34*C34 +35*C35 +36*C36 +37*C37 +38*C38 +39*C39 +40*C40 +41*C41 +42*C42 +43*C43 +44*C44 +45*C45 +46*C46 +47*C47 +48*C48 +49*C49 +50*C50 +51*C51 +52*C52 +53*C53 +54*C54) / 55) / SQR(((55^2 - 1) / 12) * ((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 +C20^2 +C21^2 +C22^2 +C23^2 +C24^2 +C25^2 +C26^2 +C27^2 +C28^2 +C29^2 +C30^2 +C31^2 +C32^2 +C33^2 +C34^2 +C35^2 +C36^2 +C37^2 +C38^2 +C39^2 +C40^2 +C41^2 +C42^2 +C43^2 +C44^2 +C45^2 +C46^2 +C47^2 +C48^2 +C49^2 +C50^2 +C51^2 +C52^2 +C53^2 +C54^2) / 55 - AVGC55^2)))^2

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
 Posted : Wednesday, August 1, 2012 3:08:41 PM

Registered User
Joined: 7/30/2007
Posts: 1,072

Sweet! :)

Quiktdr
 Posted : Thursday, August 9, 2012 4:41:27 PM
Registered User
Joined: 10/7/2004
Posts: 794

Bruce,

How would you write a 10 period lnr slope and where are you getting those #'s to input?

Bruce_L
 Posted : Thursday, August 9, 2012 4:47:23 PM

Worden Trainer

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

The Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis topic explains how the formulas are created. A 10-Period Linear Regression Slope could be written as:

(4.5 * C + 3.5 * C1 + 2.5 * C2 + 1.5 * C3 + 0.5 * C4 - 0.5 * C5 - 1.5 * C6 - 2.5 * C7 - 3.5 * C8 - 4.5 * C9) / 82.5

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
 Posted : Sunday, January 27, 2013 11:24:17 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

Hi Bruce,

Up to now I've asked for PCFs based on Fibs (5, 8, 13, 21, 34, 55).
This time I have a single "non-fib" request.

Can you please write a PCF for a 65-Period Linear Regression Slope?
Can you also write a PCF for a 65-Period R-Squared?

(It's a long story; I won't bore you with the details).

Thanks!

Bruce_L
 Posted : Monday, January 28, 2013 10:53:36 AM

Worden Trainer

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

A 65-Period Linear Regression Slope could be written as:

(32 * C + 31 * C1 + 30 * C2 + 29 * C3 + 28 * C4 + 27 * C5 + 26 * C6 + 25 * C7 + 24 * C8 + 23 * C9 + 22 * C10 + 21 * C11 + 20 * C12 + 19 * C13 + 18 * C14 + 17 * C15 + 16 * C16 + 15 * C17 + 14 * C18 + 13 * C19 + 12 * C20 + 11 * C21 + 10 * C22 + 9 * C23 + 8 * C24 + 7 * C25 + 6 * C26 + 5 * C27 + 4 * C28 + 3 * C29 + 2 * C30 + C31 - C33 - 2 * C34 - 3 * C35 - 4 * C36 - 5 * C37 - 6 * C38 - 7 * C39 - 8 * C40 - 9 * C41 - 10 * C42 - 11 * C43 - 12 * C44 - 13 * C45 - 14 * C46 - 15 * C47 - 16 * C48 - 17 * C49 - 18 * C50 - 19 * C51 - 20 * C52 - 21 * C53 - 22 * C54 - 23 * C55 - 24 * C56 - 25 * C57 - 26 * C58 - 27 * C59 - 28 * C60 - 29 * C61 - 30 * C62 - 31 * C63 - 32 * C64) / 22880

A 65-Period R-Squared could be written as:

((((65 - 1) / 2) * AVGC65 - (C1 +2*C2 +3*C3 +4*C4 +5*C5 +6*C6 +7*C7 +8*C8 +9*C9 +10*C10 +11*C11 +12*C12 +13*C13 +14*C14 +15*C15 +16*C16 +17*C17 +18*C18 +19*C19 +20*C20 +21*C21 +22*C22 +23*C23 +24*C24 +25*C25 +26*C26 +27*C27 +28*C28 +29*C29 +30*C30 +31*C31 +32*C32 +33*C33 +34*C34 +35*C35 +36*C36 +37*C37 +38*C38 +39*C39 +40*C40 +41*C41 +42*C42 +43*C43 +44*C44 +45*C45 +46*C46 +47*C47 +48*C48 +49*C49 +50*C50 +51*C51 +52*C52 +53*C53 +54*C54 +55*C55 +56*C56 +57*C57 +58*C58 +59*C59 +60*C60 +61*C61 +62*C62 +63*C63 +64*C64) / 65) / SQR(((65^2 - 1) / 12) * ((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 +C20^2 +C21^2 +C22^2 +C23^2 +C24^2 +C25^2 +C26^2 +C27^2 +C28^2 +C29^2 +C30^2 +C31^2 +C32^2 +C33^2 +C34^2 +C35^2 +C36^2 +C37^2 +C38^2 +C39^2 +C40^2 +C41^2 +C42^2 +C43^2 +C44^2 +C45^2 +C46^2 +C47^2 +C48^2 +C49^2 +C50^2 +C51^2 +C52^2 +C53^2 +C54^2 +C55^2 +C56^2 +C57^2 +C58^2 +C59^2 +C60^2 +C61^2 +C62^2 +C63^2 +C64^2) / 65 - AVGC65^2)))^2

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
 Posted : Monday, January 28, 2013 11:14:14 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

Thanks again, Bruce!

mezic
 Posted : Thursday, March 7, 2013 11:32:34 AM
Gold Customer

Joined: 5/20/2010
Posts: 33

Bruce, I hate to ask, but could you also do a 125 and 200 day LRS formula. I'm a Stockfinder user, trying to setup some of my indicators in TC2000, i'm surprised there not a standard inciator for linear regression slope.

Bruce_L
 Posted : Thursday, March 7, 2013 11:36:51 AM

Worden Trainer

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

A 125-Period Linear Regression Slope formula can be written as:

(62 * C + 61 * C1 + 60 * C2 + 59 * C3 + 58 * C4 + 57 * C5 + 56 * C6 + 55 * C7 + 54 * C8 + 53 * C9 + 52 * C10 + 51 * C11 + 50 * C12 + 49 * C13 + 48 * C14 + 47 * C15 + 46 * C16 + 45 * C17 + 44 * C18 + 43 * C19 + 42 * C20 + 41 * C21 + 40 * C22 + 39 * C23 + 38 * C24 + 37 * C25 + 36 * C26 + 35 * C27 + 34 * C28 + 33 * C29 + 32 * C30 + 31 * C31 + 30 * C32 + 29 * C33 + 28 * C34 + 27 * C35 + 26 * C36 + 25 * C37 + 24 * C38 + 23 * C39 + 22 * C40 + 21 * C41 + 20 * C42 + 19 * C43 + 18 * C44 + 17 * C45 + 16 * C46 + 15 * C47 + 14 * C48 + 13 * C49 + 12 * C50 + 11 * C51 + 10 * C52 + 9 * C53 + 8 * C54 + 7 * C55 + 6 * C56 + 5 * C57 + 4 * C58 + 3 * C59 + 2 * C60 + C61 - C63 - 2 * C64 - 3 * C65 - 4 * C66 - 5 * C67 - 6 * C68 - 7 * C69 - 8 * C70 - 9 * C71 - 10 * C72 - 11 * C73 - 12 * C74 - 13 * C75 - 14 * C76 - 15 * C77 - 16 * C78 - 17 * C79 - 18 * C80 - 19 * C81 - 20 * C82 - 21 * C83 - 22 * C84 - 23 * C85 - 24 * C86 - 25 * C87 - 26 * C88 - 27 * C89 - 28 * C90 - 29 * C91 - 30 * C92 - 31 * C93 - 32 * C94 - 33 * C95 - 34 * C96 - 35 * C97 - 36 * C98 - 37 * C99 - 38 * C100 - 39 * C101 - 40 * C102 - 41 * C103 - 42 * C104 - 43 * C105 - 44 * C106 - 45 * C107 - 46 * C108 - 47 * C109 - 48 * C110 - 49 * C111 - 50 * C112 - 51 * C113 - 52 * C114 - 53 * C115 - 54 * C116 - 55 * C117 - 56 * C118 - 57 * C119 - 58 * C120 - 59 * C121 - 60 * C122 - 61 * C123 - 62 * C124) / 162750

A 200-Period Linear Regression Slope formula can be written as:

(99.5 * C + 98.5 * C1 + 97.5 * C2 + 96.5 * C3 + 95.5 * C4 + 94.5 * C5 + 93.5 * C6 + 92.5 * C7 + 91.5 * C8 + 90.5 * C9 + 89.5 * C10 + 88.5 * C11 + 87.5 * C12 + 86.5 * C13 + 85.5 * C14 + 84.5 * C15 + 83.5 * C16 + 82.5 * C17 + 81.5 * C18 + 80.5 * C19 + 79.5 * C20 + 78.5 * C21 + 77.5 * C22 + 76.5 * C23 + 75.5 * C24 + 74.5 * C25 + 73.5 * C26 + 72.5 * C27 + 71.5 * C28 + 70.5 * C29 + 69.5 * C30 + 68.5 * C31 + 67.5 * C32 + 66.5 * C33 + 65.5 * C34 + 64.5 * C35 + 63.5 * C36 + 62.5 * C37 + 61.5 * C38 + 60.5 * C39 + 59.5 * C40 + 58.5 * C41 + 57.5 * C42 + 56.5 * C43 + 55.5 * C44 + 54.5 * C45 + 53.5 * C46 + 52.5 * C47 + 51.5 * C48 + 50.5 * C49 + 49.5 * C50 + 48.5 * C51 + 47.5 * C52 + 46.5 * C53 + 45.5 * C54 + 44.5 * C55 + 43.5 * C56 + 42.5 * C57 + 41.5 * C58 + 40.5 * C59 + 39.5 * C60 + 38.5 * C61 + 37.5 * C62 + 36.5 * C63 + 35.5 * C64 + 34.5 * C65 + 33.5 * C66 + 32.5 * C67 + 31.5 * C68 + 30.5 * C69 + 29.5 * C70 + 28.5 * C71 + 27.5 * C72 + 26.5 * C73 + 25.5 * C74 + 24.5 * C75 + 23.5 * C76 + 22.5 * C77 + 21.5 * C78 + 20.5 * C79 + 19.5 * C80 + 18.5 * C81 + 17.5 * C82 + 16.5 * C83 + 15.5 * C84 + 14.5 * C85 + 13.5 * C86 + 12.5 * C87 + 11.5 * C88 + 10.5 * C89 + 9.5 * C90 + 8.5 * C91 + 7.5 * C92 + 6.5 * C93 + 5.5 * C94 + 4.5 * C95 + 3.5 * C96 + 2.5 * C97 + 1.5 * C98 + .5 * C99 - .5 * C100 - 1.5 * C101 - 2.5 * C102 - 3.5 * C103 - 4.5 * C104 - 5.5 * C105 - 6.5 * C106 - 7.5 * C107 - 8.5 * C108 - 9.5 * C109 - 10.5 * C110 - 11.5 * C111 - 12.5 * C112 - 13.5 * C113 - 14.5 * C114 - 15.5 * C115 - 16.5 * C116 - 17.5 * C117 - 18.5 * C118 - 19.5 * C119 - 20.5 * C120 - 21.5 * C121 - 22.5 * C122 - 23.5 * C123 - 24.5 * C124 - 25.5 * C125 - 26.5 * C126 - 27.5 * C127 - 28.5 * C128 - 29.5 * C129 - 30.5 * C130 - 31.5 * C131 - 32.5 * C132 - 33.5 * C133 - 34.5 * C134 - 35.5 * C135 - 36.5 * C136 - 37.5 * C137 - 38.5 * C138 - 39.5 * C139 - 40.5 * C140 - 41.5 * C141 - 42.5 * C142 - 43.5 * C143 - 44.5 * C144 - 45.5 * C145 - 46.5 * C146 - 47.5 * C147 - 48.5 * C148 - 49.5 * C149 - 50.5 * C150 - 51.5 * C151 - 52.5 * C152 - 53.5 * C153 - 54.5 * C154 - 55.5 * C155 - 56.5 * C156 - 57.5 * C157 - 58.5 * C158 - 59.5 * C159 - 60.5 * C160 - 61.5 * C161 - 62.5 * C162 - 63.5 * C163 - 64.5 * C164 - 65.5 * C165 - 66.5 * C166 - 67.5 * C167 - 68.5 * C168 - 69.5 * C169 - 70.5 * C170 - 71.5 * C171 - 72.5 * C172 - 73.5 * C173 - 74.5 * C174 - 75.5 * C175 - 76.5 * C176 - 77.5 * C177 - 78.5 * C178 - 79.5 * C179 - 80.5 * C180 - 81.5 * C181 - 82.5 * C182 - 83.5 * C183 - 84.5 * C184 - 85.5 * C185 - 86.5 * C186 - 87.5 * C187 - 88.5 * C188 - 89.5 * C189 - 90.5 * C190 - 91.5 * C191 - 92.5 * C192 - 93.5 * C193 - 94.5 * C194 - 95.5 * C195 - 96.5 * C196 - 97.5 * C197 - 98.5 * C198 - 99.5 * C199) / 666650

Thank you for your suggestion. It has been assigned case number 10588.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
 Posted : Thursday, March 7, 2013 12:30:57 PM

Registered User
Joined: 7/30/2007
Posts: 1,072

QUOTE (mezic)
Bruce, I hate to ask, but ... I'm surprised there's not a standard indicator for linear regression slope.

Me too. I've been using Fibs so far, but it would be nice to not have to bug Bruce every time. Linear regression is a pretty common statistical technique with tons of applications.

Maybe we can put it on that "honey do" list ...

mezic
 Posted : Thursday, March 7, 2013 1:13:58 PM
Gold Customer

Joined: 5/20/2010
Posts: 33

That formula gets a bit long, but it works. Thanks. I'd suggest you ask the development team to make that a standard.

I know this is unrelated but my partner likes to do point and figure charting. I'm trying to get him to convert to TC2000/Stockfinder. Can TC do P&F charting?????

Bruce_L
 Posted : Thursday, March 7, 2013 1:24:02 PM

Worden Trainer

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

Neither program can do traditional point and figure charting.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
mezic
 Posted : Thursday, March 7, 2013 5:58:32 PM
Gold Customer

Joined: 5/20/2010
Posts: 33

Thanks Bruce. Sorry to hear that. Stockfinder does have a P&F template, but I couldn't figure out how to set the parameters correctly.....although i didn't spend much time on it either.

QUOTE (Bruce_L)

Neither program can do traditional point and figure charting.

Bruce_L
 Posted : Friday, March 8, 2013 7:37:23 AM

Worden Trainer

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

The Point&figure topic has more information on the current state of Point and Figure Charts in StockFinder and why it won't actually plot traditional Point and Figure Charts.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
 Posted : Sunday, June 29, 2014 2:22:00 PM

Registered User
Joined: 7/30/2007
Posts: 1,072
Hi Bruce,

When you have a chance ...

Can you please write a PCF for a 50-Period Linear Regression Slope?
And a PCF for a 50-Period R-Squared?

You're the best ... thanks!
Bruce_L
 Posted : Monday, June 30, 2014 10:41:06 AM

Worden Trainer

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

A 50-period moving linear regression slope Indicator Formula can 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

A 50-period R-squared Indicator Formula can be written as:

((((50 - 1) / 2) * AVGC50 - (C1 +2*C2 +3*C3 +4*C4 +5*C5 +6*C6 +7*C7 +8*C8 +9*C9 +10*C10 +11*C11 +12*C12 +13*C13 +14*C14 +15*C15 +16*C16 +17*C17 +18*C18 +19*C19 +20*C20 +21*C21 +22*C22 +23*C23 +24*C24 +25*C25 +26*C26 +27*C27 +28*C28 +29*C29 +30*C30 +31*C31 +32*C32 +33*C33 +34*C34 +35*C35 +36*C36 +37*C37 +38*C38 +39*C39 +40*C40 +41*C41 +42*C42 +43*C43 +44*C44 +45*C45 +46*C46 +47*C47 +48*C48 +49*C49) / 50) / SQR(((50^2 - 1) / 12) * ((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 +C20^2 +C21^2 +C22^2 +C23^2 +C24^2 +C25^2 +C26^2 +C27^2 +C28^2 +C29^2 +C30^2 +C31^2 +C32^2 +C33^2 +C34^2 +C35^2 +C36^2 +C37^2 +C38^2 +C39^2 +C40^2 +C41^2 +C42^2 +C43^2 +C44^2 +C45^2 +C46^2 +C47^2 +C48^2 +C49^2) / 50 - AVGC50^2)))^2

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Georgios54
 Posted : Monday, March 30, 2015 3:47:50 PM
Registered User
Joined: 3/23/2015
Posts: 1

Hi Bruce:

Could you please provide the formula for a  15-period Linear Regression Slope?

Best,

George

Bruce_L
 Posted : Monday, March 30, 2015 3:52:00 PM

Worden Trainer

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

Please try the following Indicator Formula.

(7 * (C - C14) + 6 * (C1 - C13) + 5 * (C2 - C12) + 4 * (C3 - C11) + 3 * (C4 - C10) + 2 * (C5 - C9) + C6 - C8) / 280

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
 Posted : Wednesday, December 30, 2015 4:23:51 PM

Registered User
Joined: 7/30/2007
Posts: 1,072

Hi Bruce, can you create...

• A 30-period moving linear regression slope Indicator Formula
• A 30-period R-squared Indicator Formula

Thanks!

Bruce_L
 Posted : Wednesday, December 30, 2015 4:29:08 PM

Worden Trainer

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

A 30 period linear regression slope can be writen as follows.

(14.5 * C + 13.5 * C1 + 12.5 * C2 + 11.5 * C3 + 10.5 * C4 + 9.5 * C5 + 8.5 * C6 + 7.5 * C7 + 6.5 * C8 + 5.5 * C9 + 4.5 * C10 + 3.5 * C11 + 2.5 * C12 + 1.5 * C13 + 0.5 * C14 - 0.5 * C15 - 1.5 * C16 - 2.5 * C17 - 3.5 * C18 - 4.5 * C19 - 5.5 * C20 - 6.5 * C21 - 7.5 * C22 - 8.5 * C23 - 9.5 * C24 - 10.5 * C25 - 11.5 * C26 - 12.5 * C27 - 13.5 * C28 - 14.5 * C29) / 2247.5

A 30 period R-squared Indicator Formula can be written as follows.

((((30 - 1) / 2) * AVGC30 - (C1 +2*C2 +3*C3 +4*C4 +5*C5 +6*C6 +7*C7 +8*C8 +9*C9 +10*C10 +11*C11 +12*C12 +13*C13 +14*C14 +15*C15 +16*C16 +17*C17 +18*C18 +19*C19 +20*C20 +21*C21 +22*C22 +23*C23 +24*C24 +25*C25 +26*C26 +27*C27 +28*C28 +29*C29) / 30) / SQR(((30^2 - 1) / 12) * ((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 +C20^2 +C21^2 +C22^2 +C23^2 +C24^2 +C25^2 +C26^2 +C27^2 +C28^2 +C29^2) / 30 - AVGC30^2)))^2

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
 Posted : Wednesday, December 30, 2015 4:46:22 PM

Registered User
Joined: 7/30/2007
Posts: 1,072

Awesome, Bruce. Thank you. Happy New Year!!

Bruce_L
 Posted : Wednesday, December 30, 2015 5:26:55 PM

Worden Trainer

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

You're welcome. Happy New Year!

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
MoreAces
 Posted : Wednesday, January 27, 2016 11:19:18 PM
Registered User
Joined: 8/23/2013
Posts: 245

QUOTE (Bruce_L)

Please try the following Indicator Formula.

(7 * (C - C14) + 6 * (C1 - C13) + 5 * (C2 - C12) + 4 * (C3 - C11) + 3 * (C4 - C10) + 2 * (C5 - C9) + C6 - C8) / 280

Still getting syntax error

Bruce_L
 Posted : Thursday, January 28, 2016 10:41:08 AM

Worden Trainer

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

Are you using Internet Explorer or Edge when copying formulas from the forums into TC2000? If so, try copying and pasting the formula into Notepad and then copying and pasting the formula from Notepad into TC2000 instead of copying and pasting directly from the forums into TC2000.

Another option would be to use Chrome instead as it doesn't seem to be adding extra formatting like IE and Edge.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
diceman
 Posted : Thursday, January 28, 2016 11:46:03 AM
Registered User
Joined: 1/28/2005
Posts: 6,049

QUOTE (Bruce_L)

Are you using Internet Explorer or Edge when copying formulas from the forums into TC2000? If so, try copying and pasting the formula into Notepad and then copying and pasting the formula from Notepad into TC2000 instead of copying and pasting directly from the forums into TC2000.

Another option would be to use Chrome instead as it doesn't seem to be adding extra formatting like IE and Edge.

Is that only on VER.16 ?

Thanks diceman

Bruce_L
 Posted : Thursday, January 28, 2016 12:06:26 PM

Worden Trainer

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

It has always happened to some extent (MS Word and MS Outlook are much bigger offenders than MS Internet Explorer or MS Edge). It does seem to be worse when pasting into v16 than v7 or v12 however.

It is not just that various MS programs pass through formatting, but that the programs will actually try to "correct" things and then pass through the corrections. For example, Microsoft will frequently convert the single quotes used in the date syntax in PCFs into "smart quotes", turn a minus sign into a dash of some sort, add carriage returns and line feeds which weren't actually part of the copy and change/create font styles which weren't part of the copy.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
MoreAces
 Posted : Thursday, January 28, 2016 6:51:11 PM
Registered User
Joined: 8/23/2013
Posts: 245

I dont usually have that problem but that was exactly what was wrong.  Pasted in Notepad, re-copied, then pasted into tc2000 and was all good

Bruce_L
 Posted : Friday, January 29, 2016 9:15:03 AM

Worden Trainer

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

I am happy to read that Notepad was able to resolve the issue.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
 Posted : Monday, July 25, 2016 3:03:55 PM

Registered User
Joined: 7/30/2007
Posts: 1,072

Hi Bruce,

Can you double-check the 8-period R-Squared PCF below. I plotted all the R-Squared PCFs on one chart for comparison, and the 8-bar looks out of place with the others. Not sure what's going on. The chart is for QQQ, 10-minute, all 500 bars...

QUOTE (Bruce_L)

QUOTE (Putt4Dough)
8-period R-Squared

(((8 - 1) / 2 * AVGC8 - (C1 + 2 * C2 + 3 * C3 + 4 * C4 + 5 * C5 + 6 * C6 + 7 * C7) / 8) / SQR((8 ^ 2 - 1) / 12 * ((C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2) / 8 - AVGC8 ^ 2))) ^ 2

Bruce_L
 Posted : Monday, July 25, 2016 3:19:31 PM

Worden Trainer

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

The formula appears to be correct. The spikes are just caused by this section of the formula being very close to zero.

(C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2) / 8 - AVGC8 ^ 2

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
 Posted : Monday, July 25, 2016 3:32:50 PM

Registered User
Joined: 7/30/2007
Posts: 1,072

Thanks for the confirmation Bruce. Now that I look at the scales to the right, those two spikes seemed to have compressed the plot. It just looks weird compared to the 5-bar above it and the 13-bar below it.

Bruce_L
 Posted : Monday, July 25, 2016 3:51:58 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 Customer Training & Support - Ask a Trainer - TC2000 version 12/18 - Ask a Trainer - TC2000 version 7 - Ask a Trainer - StockFinder 5.0 - PCFs, EasyScan and Custom Indicators General Discussions - Stock and Market Talk - TC2000 version 12 or 18 - TC2000 version 7 - StockFinder 5.0 - RealCode for StockFinder 5.0 Tutorial Videos - TC2000 version 12 tutorial videos - TC2000 version 7 tutorial videos 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.