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 moving average Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
diceman
Posted : Saturday, April 22, 2006 1:50:24 AM
Registered User
Joined: 1/28/2005
Posts: 6,049
Have any equations for linear regression moving averages been posted here?

I would assume they have to be created to be used in custom indicators and do not
exist in the XAVGC20 and AVGC20 format of the other moving averages.

When I searched the topic it seems most of the posts referenced straight line linear regression equations.(even though the question was about moving LR)

I have a problem when I search. I can only see the first page. When I click to view
the second page I get: "SERVER ERROR IN / TRAINING APPLICATION".
I don't know if the problem is at my end of the computer or yours?

I would be interested in a Linear regression moving average of the close.
In 5, 10, and 20 bar lengths.

Thanks

bustermu
Posted : Saturday, April 22, 2006 8:49:47 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
diceman.

If you have a PCF for LRSlopeP, then LRMAP is given by:

LRMAP = AVGCP+((P-1)/2)*LRSlopeP

If you would like the formula for LRSlopeP, I will supply that also.

Please see:

Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis

I am sure Bruce will give you LRMAP for P = 5,10,20.

Thanks,
Jim Murphy
Craig_S
Posted : Saturday, April 22, 2006 9:03:19 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
diceman, are you using firefox? I get that error in firefox if I try to go to the second page of a topic/search before the first one finishes loading.

- Craig
Here to Help!
diceman
Posted : Saturday, April 22, 2006 9:32:37 AM
Registered User
Joined: 1/28/2005
Posts: 6,049
I'm not sure what firefox is?
(so I guess that would mean I'm not using it (ha ha))

I usually open windows internet explorer with google as my homepage.
Just to make sure my internet connection is up.

I type "worden" in search. Usually the first search is the homepage.

I don't know if the fact that I'm going through google is forcing me
to use firefox?

Thanks
Craig_S
Posted : Saturday, April 22, 2006 9:33:05 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
Not to screw up anyone's task assignments but I will provide the formulas.

5-period MLR

AVGC5+2*(( 2*C0 +1*C1 +0*C2 -1*C3 -2*C4 ) / 10)

10-period MLR
AVGC10+4.5*((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)

20-period MLR
AVGC20+9.5*((9.5*C+ 8.5*C1+ 7.5*C2 +6.5*C3 +5.5*C4 +4.5*C5 +3.5*C6 +2.5*C7 +1.5*C8 +0.5*C9 -0.5*C10 -1.5*C11 -2.5*C12 -3.5*C13 -4.5*C14 -5.5*C15 -6.5*C16 -7.5*C17 -8.5*C18 -9.5*C19)/665)

- Craig
Here to Help!
Craig_S
Posted : Saturday, April 22, 2006 9:34:26 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
Firefox is another browser to use instead of Internet Explorer.

Do you get this everytime to try to go to a second page in a thread or only a second page in a search?

- Craig
Here to Help!
diceman
Posted : Saturday, April 22, 2006 9:45:06 AM
Registered User
Joined: 1/28/2005
Posts: 6,049
Thanks for the equations Craig.

I don't think it has happened every time but I would say it happens more often then
not.

I have only seen it in the "search" mode.

In threads I always get the other pages.

My only tool to get around it has been to increase the view.
(100 per page)

and refine the search.

Thanks
Craig_S
Posted : Saturday, April 22, 2006 9:49:20 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
Huh.

We have us a nice puzzle!

What version of Internet Explorer are you using. CLick on HELP|ABOUT in your browser and check for me.

- Craig
Here to Help!
diceman
Posted : Saturday, April 22, 2006 10:13:18 AM
Registered User
Joined: 1/28/2005
Posts: 6,049
Version 6.0

Its on a "2002 vintage" compaq computer.

I had a problem with a virus last year that caused me to reformat and reboot
the hard drive.

So it has no updates on it. Its in the form it was in 2002 out of the box.

Maybe that has something to do with it?

Thanks
Craig_S
Posted : Saturday, April 22, 2006 10:16:27 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
I wish I knew.

For security reasons you should consider updating your Internet Explorer to version 6.0.2900.2180.xpsp_sp2_gdr.050301-1519 if you have not already.

- Craig
Here to Help!
tedk
Posted : Thursday, June 7, 2007 7:58:13 PM
Registered User
Joined: 10/7/2004
Posts: 28
Craig,
Can you tell me how the last number is calculated i.e., 10, 82.5 and 665?
Thanks.
tedk
diceman
Posted : Thursday, June 7, 2007 8:37:21 PM
Registered User
Joined: 1/28/2005
Posts: 6,049
It is the sum of the squared values that are multiplied
by the price:

4.5=20.25

3.5=12.25

2.5=6.25

1.5=2.25

0.5=0.25

-0.5=0.25

-1.5=2.25

-2.5=6.25

-3.5=12.25

-4.5=20.25

SUM = 82.5


Thanks
diceman
bustermu
Posted : Friday, June 8, 2007 10:19:53 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
tedk,

Please see the 04/04/06, 12:12:34 PM post at:

Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis

If P is the period of the LRMA, a formula for the denominator of which you are inquiring is:

Denom = (P-1)*P*(P+1)/12 = P*(P^2-1)/12

Thanks,
Jim Murphy
wilsonchoi
Posted : Monday, December 17, 2012 9:19:57 PM
Registered User
Joined: 12/17/2012
Posts: 6

diceman,

Hi! I am a student from China. Can you tell me what Linear Regression Moving Average is? What's the formula?

Thanks!

wilsonchoi
Posted : Monday, December 17, 2012 9:26:44 PM
Registered User
Joined: 12/17/2012
Posts: 6

Craig S,

What's the difference between LRMA and MLR? What do C1, C2... indicate?

Thanks!

wilsonchoi
Posted : Monday, December 17, 2012 9:43:26 PM
Registered User
Joined: 12/17/2012
Posts: 6

QUOTE (Craig_S)
Not to screw up anyone's task assignments but I will provide the formulas.

5-period MLR

AVGC5+2*(( 2*C0 +1*C1 +0*C2 -1*C3 -2*C4 ) / 10)

10-period MLR
AVGC10+4.5*((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)

20-period MLR
AVGC20+9.5*((9.5*C+ 8.5*C1+ 7.5*C2 +6.5*C3 +5.5*C4 +4.5*C5 +3.5*C6 +2.5*C7 +1.5*C8 +0.5*C9 -0.5*C10 -1.5*C11 -2.5*C12 -3.5*C13 -4.5*C14 -5.5*C15 -6.5*C16 -7.5*C17 -8.5*C18 -9.5*C19)/665)

 

Craig S,

What's the difference between LRMA and MLR? What do C1, C2... indicate?

Thanks!

diceman
Posted : Monday, December 17, 2012 10:44:21 PM
Registered User
Joined: 1/28/2005
Posts: 6,049

I believe LRMA and MLR are the same thing just said differently.

C1 is yesterdays close

C2 is the day before

and so on.

…on a daily chart.

 

 

 

Thanks

wilsonchoi
Posted : Tuesday, December 18, 2012 12:37:33 AM
Registered User
Joined: 12/17/2012
Posts: 6

diceman,

I think i know what LRMA is now. The LRMA value is just the estimated value of the day, predicted by a linear regression model, which is trained by the recent data.

Thanks for your reply!

Bruce_L
Posted : Tuesday, December 18, 2012 8:06:22 AM


Worden Trainer

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

Moving Linear Regression and Linear Regression Moving Average are two different terms for the same thing. A Moving Linear Regression Plots the right endpoints of a Linear Regression Line over time.

It can be thought of as an estimated value for the day as predicted by a linear regression model, but it can also be thought of as a zero lag method of smoothing.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
wilsonchoi
Posted : Tuesday, December 18, 2012 11:53:59 PM
Registered User
Joined: 12/17/2012
Posts: 6

QUOTE (Bruce_L)

Moving Linear Regression and Linear Regression Moving Average are two different terms for the same thing. A Moving Linear Regression Plots the right endpoints of a Linear Regression Line over time.

It can be thought of as an estimated value for the day as predicted by a linear regression model, but it can also be thought of as a zero lag method of smoothing.

Thanks for the explanation, Bruce L. I read some of your posts. Those really help me a lot!

Is LRMA really zero lag? I don't think it is. It shows the trend over the past few days. It does lag less than SMA. But I think it still lags.

Bruce_L
Posted : Wednesday, December 19, 2012 8:37:27 AM


Worden Trainer

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

Yes, it really is zero lag.

Lag Efficient Moving Average



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
wilsonchoi
Posted : Wednesday, December 19, 2012 10:50:04 PM
Registered User
Joined: 12/17/2012
Posts: 6

QUOTE (Bruce_L)

Yes, it really is zero lag.

Lag Efficient Moving Average

Thank you very much, Bruce_L! Now I know the definition of the lag of an serie.

 

Bruce_L
Posted : Thursday, December 20, 2012 8:30:22 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.