Registered User Joined: 6/30/2017 Posts: 1,227
|
Hi Bruce,
I know there's a template somewhere around here (if you give me the link I'll bookmark it for next time) but for now ... there's a new barista today and she's cute. ;)
What are the PCFs for a 34-period Linear Regression Slope and a 34-period Linear Regression R-Squared? I'd like to plot them, and add them as value columns. Eventually I might use them as condition columns, depending on the setup.
Thanks!
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The following would be the 45 period linear regression slope.
6 * (FAVG(C,45) - AVG(C, 45)) / (45 - 1)
The following would be the 45 period annualized regression slope.
100 * (EXP(253 * 6 * (FAVG(LOG(C ), 45) - AVG(LOG(C ), 45)) / (45 - 1)) - 1)
And the following would be the 45 period R-Squared.
((45 + 1) / 2 * (FAVG(C, 45) - AVG(C, 45)) / SQR((45 ^ 2 - 1) * (AVG((C ) ^ 2, 45) - AVG(C, 45) ^ 2) / 12)) ^ 2
You can change all instances of 45 in the formulas to change the period. And you can replace all instances of C with something else if you want the values to be based on something besides closing prices.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 6/30/2017 Posts: 1,227
|
Awesome, Bruce. Thanks!
If the barista has a sister, I'll let you know.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|