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 |

Linear Regression for a past date Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
rwsmilie
Posted : Saturday, May 28, 2005 7:39:35 PM
Registered User
Joined: 11/11/2004
Posts: 38
Is there a way to do PCF or easy scan sorts for a past date? For example, I want to do a linear regression sort that uses 13May05 as the last day of the 50 day regression line.

Thanks
Bruce_L
Posted : Sunday, May 29, 2005 12:48:08 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Try this as a Personal Criteria Formula:

LR50.'5/13/05'
AVGC50.'5/13/05'+24.5*(24.5*C'5/13/05' +23.5*C'5/12/05' +22.5*C'5/11/05' +21.5*C'5/10/05' +20.5*C'5/9/05' +19.5*C'5/6/05' +18.5*C'5/5/05' +17.5*C'5/4/05' +16.5*C'5/3/05' +15.5*C'5/2/05' +14.5*C'4/29/05' +13.5*C'4/28/05' +12.5*C'4/27/05' +11.5*C'4/26/05' +10.5*C'4/25/05' +9.5*C'4/22/05' +8.5*C'4/21/05' +7.5*C'4/20/05' +6.5*C'4/19/05' +5.5*C'4/18/05' +4.5*C'4/15/05' +3.5*C'4/14/05' +2.5*C'4/13/05' +1.5*C'4/12/05' +0.5*C'4/11/05' -0.5*C'4/8/05' -1.5*C'4/7/05' -2.5*C'4/6/05' -3.5*C'4/5/05' -4.5*C'4/4/05' -5.5*C'4/1/05' -6.5*C'3/31/05' -7.5*C'3/30/05' -8.5*C'3/29/05' -9.5*C'3/28/05' -10.5*C'3/24/05' -11.5*C'3/23/05' -12.5*C'3/22/05' -13.5*C'3/21/05' -14.5*C'3/18/05' -15.5*C'3/17/05' -16.5*C'3/16/05' -17.5*C'3/15/05' -18.5*C'3/14/05' -19.5*C'3/11/05' -20.5*C'3/10/05' -21.5*C'3/9/05'-22.5*C'3/8/05' -23.5*C'3/7/05' -24.5*C'3/4/05')/10412.5

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
rwsmilie
Posted : Sunday, May 29, 2005 5:52:21 PM
Registered User
Joined: 11/11/2004
Posts: 38
Thanks. I'll give it a try.
markacz
Posted : Wednesday, June 1, 2005 12:14:11 AM
Gold Customer Gold Customer

Joined: 5/4/2005
Posts: 74
Is it possible to use the "linear regression" indicator and merely adjust the extension such that the last bar of the regression is 13 May 05. This can be accomplished easily visually.
Doug_H
Posted : Wednesday, June 1, 2005 12:18:09 AM


Worden Trainer

Joined: 10/1/2004
Posts: 4,308
You should be able to plot the Linear Regression Line back to May 13 by counting the number of trading days back to that date, and using that number as the period for the regression line. Have I misunderstood something, or will that work for you?

- Doug
Teaching Online!
markacz
Posted : Friday, June 3, 2005 9:42:57 PM
Gold Customer Gold Customer

Joined: 5/4/2005
Posts: 74
Doug:
I was merely suggesting that using the extended linear regression is somewhat less complicated than the PCF expression above. Works for me.
markacz
StockGuy
Posted : Friday, June 3, 2005 9:46:07 PM

Administration

Joined: 9/30/2004
Posts: 9,187
QUOTE (markacz)
Doug:
I was merely suggesting that using the extended linear regression is somewhat less complicated than the PCF expression above. Works for me.
markacz


I think you and Doug were replying at about the same time with the same suggestion.
Tanstaafl
Posted : Monday, June 6, 2005 12:44:39 AM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
Here is a PCF for the value of the Linear Regresson line that is based on 50 bars ending 15 bars ago, with an extension of that line to today's value. That is, if it is plotted in the top pane, it will show the same result in the databox as a Price-based LinReg Child with inputs of 50,15,0:

( 24.5*C15 +23.5*C16 +22.5*C17 +21.5*C18 +20.5*C19 +19.5*C20 +18.5*C21 +17.5*C22 +16.5*C23 +15.5*C24 +14.5*C25 +13.5*C26 +12.5*C27 +11.5*C28 +10.5*C29 +9.5*C30 +8.5*C31 +7.5*C32 +6.5*C33 +5.5*C34 +4.5*C35 +3.5*C36 +2.5*C37 +1.5*C38 +0.5*C39 -0.5*C40 -1.5*C41 -2.5*C42 -3.5*C43 -4.5*C44 -5.5*C45 -6.5*C46 -7.5*C47 -8.5*C48 -9.5*C49 -10.5*C50 -11.5*C51 -12.5*C52 -13.5*C53 -14.5*C54 -15.5*C55 -16.5*C56 -17.5*C57 -18.5*C58 -19.5*C59 -20.5*C60 -21.5*C61 -22.5*C62 -23.5*C63 -24.5*C64 ) / 10412.5 * 39.5 + AvgC50.15

15 days ago is by the way May 15th as of June 6th :~)

If you wanted to know the value of the LinReg 50,15,0 AS OF 15 days ago, here is the formula:

( 24.5*C15 +23.5*C16 +22.5*C17 +21.5*C18 +20.5*C19 +19.5*C20 +18.5*C21 +17.5*C22 +16.5*C23 +15.5*C24 +14.5*C25 +13.5*C26 +12.5*C27 +11.5*C28 +10.5*C29 +9.5*C30 +8.5*C31 +7.5*C32 +6.5*C33 +5.5*C34 +4.5*C35 +3.5*C36 +2.5*C37 +1.5*C38 +0.5*C39 -0.5*C40 -1.5*C41 -2.5*C42 -3.5*C43 -4.5*C44 -5.5*C45 -6.5*C46 -7.5*C47 -8.5*C48 -9.5*C49 -10.5*C50 -11.5*C51 -12.5*C52 -13.5*C53 -14.5*C54 -15.5*C55 -16.5*C56 -17.5*C57 -18.5*C58 -19.5*C59 -20.5*C60 -21.5*C61 -22.5*C62 -23.5*C63 -24.5*C64 ) / 10412.5 * 24.5 + AvgC50.15

The formula for the SLOPE of the LinReg 50,15 is:

( 24.5*C15 +23.5*C16 +22.5*C17 +21.5*C18 +20.5*C19 +19.5*C20 +18.5*C21 +17.5*C22 +16.5*C23 +15.5*C24 +14.5*C25 +13.5*C26 +12.5*C27 +11.5*C28 +10.5*C29 +9.5*C30 +8.5*C31 +7.5*C32 +6.5*C33 +5.5*C34 +4.5*C35 +3.5*C36 +2.5*C37 +1.5*C38 +0.5*C39 -0.5*C40 -1.5*C41 -2.5*C42 -3.5*C43 -4.5*C44 -5.5*C45 -6.5*C46 -7.5*C47 -8.5*C48 -9.5*C49 -10.5*C50 -11.5*C51 -12.5*C52 -13.5*C53 -14.5*C54 -15.5*C55 -16.5*C56 -17.5*C57 -18.5*C58 -19.5*C59 -20.5*C60 -21.5*C61 -22.5*C62 -23.5*C63 -24.5*C64 ) / 10412.5

Enjoy!

Jim Dean


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.