Nicolas

Momentum Linear Regression

Category: Indicators By: Nicolas Created: July 23, 2015, 9:06 PM
July 23, 2015, 9:06 PM
Indicators
3 Comments
Momentum Linear Regression

This is an indicator made of the linear regression applied to the rate of change of price (or momentum).

I made a simple signal line just by duplicating the first one within a period decay in the past, to make those 2 lines cross. You can add more periods decay to made signal smoother with less false entry.

 

//parameters : 
//MOM = 10
//LR = 14
//decay = 1

MOMENT = Momentum[MOM](Close) 
LRMOM = LinearRegression[LR](MOMENT) 
LRMOMDECAY = LRMOM[DECAY]

RETURN LRMOM,LRMOMDECAY

 

Download
Filename: Linear-Regression-of-Momentum.itf
Downloads: 330
Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

SB-FO
6 years ago
#

Moving your last response to this post. Thanks for conforming the code below. How does PRT/PRC code Momentum? Is it (C / CP) ? Using the code above, LRMOM = LinearRegression [LR] (MOMENT) I get a volatile result. If I use LRMOM = LinearRegression[LR] - (MOMENT) I get a smooth result. Hence my question, please advise. SB-FO • 17 hours ago # Nicolas, can you share with me how PRT calculates LinearRegression ? Is it (3 * WeightedAverage Close X – 2 * AVERAGE Close X) X= Period? avatar Nicolas • 8 hours ago # The above code is the way it is calculated in PRT. However the exact indicator can be found here: https://www.prorealcode.com/prorealtime-indicators/standard-deviation-standard-error-linear-regression-channel/

Nicolas
6 years ago
#

It is obtained by substracting the x days before Close from today’s Close. X is the parameter associated with Momentum. https://www.prorealcode.com/documentation/momentum/

Vicari0us
8 years ago
#

Really liking this indicator. Thanks

ProRealCode ProRealCode
Loading...