MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

 A B C D E F G H I J K L M N O P R S T U V W Y Z #

Slope of a Linear Regression Line
rev. 01/06/97 The following custom formula will return the slope of a 14 day linear regression line.

Slope of a 14 Day Linear Regression Line

((Sum(Cum(1) * ((14*Sum(Cum(1) * C,14) - Sum(Cum(1),14) * Sum(C,14)) /
(14 * Sum(Pwr(Cum(1),2),14) - Pwr(Sum(Cum(1),14),2)) *
Cum(1) + (Mov(C,14,S) - Mov(Cum(1),14,S) * (14 * Sum(Cum(1) * C,14) -
Sum(Cum(1),14) * Sum(C,14)) / (14 * Sum(Pwr(Cum(1),2),14)- Pwr(Sum(Cum(1),14),2)))),14)) -
(Sum(Cum(1),14) * Sum(((14 * Sum(Cum(1) * C,14) -Sum(Cum(1),14) *
Sum(C,14)) / (14 * Sum(Pwr(Cum(1),2),14) -Pwr(Sum(Cum(1),14),2)) *
Cum(1) + (Mov(C,14,S) - Mov(Cum(1),14,S) * (14 * Sum(Cum(1) * C,14) -Sum(Cum(1),14) *
Sum(C,14)) / (14 * Sum(Pwr(Cum(1),2),14) - Pwr(Sum(Cum(1),14),2)))),14) / 14)) /
((Sum(Power(Cum(1),2),14)) - (Power(Sum(Cum(1),14),2)/ 14))

** You can change the time periods by replacing every occurrence of 14 with you desired time period.

rev. 01/06/97

The following custom formula will return the slope of a Linear Regression Line.

Slope of a Linear Regression Line

tp:=Input("Time Periods",1,200,21);
((tp*(Sum(Cum(1)*C,tp)))-(Sum(Cum(1),tp)*(Sum(C,tp))))/
((tp*Sum(Pwr(Cum(1),2),tp))-Pwr(Sum(Cum(1),tp),2))

Source / From: TOP
http://www.equis.com

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.