Registered User Joined: 5/9/2011 Posts: 80
|
Hi Bruce,
Can you help me with calculating the slope of a moving average using Linear Regression?
For instance, can we determine the slope of a 200 SMA for a 30 period and 180 periods and the same thing for 20 SMA 15 and 30 periods?
If the 180 periods is too long for the 200 SMA to calculate that slope, then we can convert that calculation using weeks...
Thanks, Jim
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
30 period linear regression slope of 200 period simple moving average:
(14.5 * AVGC200 + 13.5 * AVGC200.1 + 12.5 * AVGC200.2 + 11.5 * AVGC200.3 + 10.5 * AVGC200.4 + 9.5 * AVGC200.5 + 8.5 * AVGC200.6 + 7.5 * AVGC200.7 + 6.5 * AVGC200.8 + 5.5 * AVGC200.9 + 4.5 * AVGC200.10 + 3.5 * AVGC200.11 + 2.5 * AVGC200.12 + 1.5 * AVGC200.13 + 0.5 * AVGC200.14 - 0.5 * AVGC200.15 - 1.5 * AVGC200.16 - 2.5 * AVGC200.17 - 3.5 * AVGC200.18 - 4.5 * AVGC200.19 - 5.5 * AVGC200.20 - 6.5 * AVGC200.21 - 7.5 * AVGC200.22 - 8.5 * AVGC200.23 - 9.5 * AVGC200.24 - 10.5 * AVGC200.25 - 11.5 * AVGC200.26 - 12.5 * AVGC200.27 - 13.5 * AVGC200.28 - 14.5 * AVGC200.29) / 2247.5
180 period linear regression slope of 200 period simple moving average:
(89.5 * AVGC200 + 88.5 * AVGC200.1 + 87.5 * AVGC200.2 + 86.5 * AVGC200.3 + 85.5 * AVGC200.4 + 84.5 * AVGC200.5 + 83.5 * AVGC200.6 + 82.5 * AVGC200.7 + 81.5 * AVGC200.8 + 80.5 * AVGC200.9 + 79.5 * AVGC200.10 + 78.5 * AVGC200.11 + 77.5 * AVGC200.12 + 76.5 * AVGC200.13 + 75.5 * AVGC200.14 + 74.5 * AVGC200.15 + 73.5 * AVGC200.16 + 72.5 * AVGC200.17 + 71.5 * AVGC200.18 + 70.5 * AVGC200.19 + 69.5 * AVGC200.20 + 68.5 * AVGC200.21 + 67.5 * AVGC200.22 + 66.5 * AVGC200.23 + 65.5 * AVGC200.24 + 64.5 * AVGC200.25 + 63.5 * AVGC200.26 + 62.5 * AVGC200.27 + 61.5 * AVGC200.28 + 60.5 * AVGC200.29 + 59.5 * AVGC200.30 + 58.5 * AVGC200.31 + 57.5 * AVGC200.32 + 56.5 * AVGC200.33 + 55.5 * AVGC200.34 + 54.5 * AVGC200.35 + 53.5 * AVGC200.36 + 52.5 * AVGC200.37 + 51.5 * AVGC200.38 + 50.5 * AVGC200.39 + 49.5 * AVGC200.40 + 48.5 * AVGC200.41 + 47.5 * AVGC200.42 + 46.5 * AVGC200.43 + 45.5 * AVGC200.44 + 44.5 * AVGC200.45 + 43.5 * AVGC200.46 + 42.5 * AVGC200.47 + 41.5 * AVGC200.48 + 40.5 * AVGC200.49 + 39.5 * AVGC200.50 + 38.5 * AVGC200.51 + 37.5 * AVGC200.52 + 36.5 * AVGC200.53 + 35.5 * AVGC200.54 + 34.5 * AVGC200.55 + 33.5 * AVGC200.56 + 32.5 * AVGC200.57 + 31.5 * AVGC200.58 + 30.5 * AVGC200.59 + 29.5 * AVGC200.60 + 28.5 * AVGC200.61 + 27.5 * AVGC200.62 + 26.5 * AVGC200.63 + 25.5 * AVGC200.64 + 24.5 * AVGC200.65 + 23.5 * AVGC200.66 + 22.5 * AVGC200.67 + 21.5 * AVGC200.68 + 20.5 * AVGC200.69 + 19.5 * AVGC200.70 + 18.5 * AVGC200.71 + 17.5 * AVGC200.72 + 16.5 * AVGC200.73 + 15.5 * AVGC200.74 + 14.5 * AVGC200.75 + 13.5 * AVGC200.76 + 12.5 * AVGC200.77 + 11.5 * AVGC200.78 + 10.5 * AVGC200.79 + 9.5 * AVGC200.80 + 8.5 * AVGC200.81 + 7.5 * AVGC200.82 + 6.5 * AVGC200.83 + 5.5 * AVGC200.84 + 4.5 * AVGC200.85 + 3.5 * AVGC200.86 + 2.5 * AVGC200.87 + 1.5 * AVGC200.88 + 0.5 * AVGC200.89 - 0.5 * AVGC200.90 - 1.5 * AVGC200.91 - 2.5 * AVGC200.92 - 3.5 * AVGC200.93 - 4.5 * AVGC200.94 - 5.5 * AVGC200.95 - 6.5 * AVGC200.96 - 7.5 * AVGC200.97 - 8.5 * AVGC200.98 - 9.5 * AVGC200.99 - 10.5 * AVGC200.100 - 11.5 * AVGC200.101 - 12.5 * AVGC200.102 - 13.5 * AVGC200.103 - 14.5 * AVGC200.104 - 15.5 * AVGC200.105 - 16.5 * AVGC200.106 - 17.5 * AVGC200.107 - 18.5 * AVGC200.108 - 19.5 * AVGC200.109 - 20.5 * AVGC200.110 - 21.5 * AVGC200.111 - 22.5 * AVGC200.112 - 23.5 * AVGC200.113 - 24.5 * AVGC200.114 - 25.5 * AVGC200.115 - 26.5 * AVGC200.116 - 27.5 * AVGC200.117 - 28.5 * AVGC200.118 - 29.5 * AVGC200.119 - 30.5 * AVGC200.120 - 31.5 * AVGC200.121 - 32.5 * AVGC200.122 - 33.5 * AVGC200.123 - 34.5 * AVGC200.124 - 35.5 * AVGC200.125 - 36.5 * AVGC200.126 - 37.5 * AVGC200.127 - 38.5 * AVGC200.128 - 39.5 * AVGC200.129 - 40.5 * AVGC200.130 - 41.5 * AVGC200.131 - 42.5 * AVGC200.132 - 43.5 * AVGC200.133 - 44.5 * AVGC200.134 - 45.5 * AVGC200.135 - 46.5 * AVGC200.136 - 47.5 * AVGC200.137 - 48.5 * AVGC200.138 - 49.5 * AVGC200.139 - 50.5 * AVGC200.140 - 51.5 * AVGC200.141 - 52.5 * AVGC200.142 - 53.5 * AVGC200.143 - 54.5 * AVGC200.144 - 55.5 * AVGC200.145 - 56.5 * AVGC200.146 - 57.5 * AVGC200.147 - 58.5 * AVGC200.148 - 59.5 * AVGC200.149 - 60.5 * AVGC200.150 - 61.5 * AVGC200.151 - 62.5 * AVGC200.152 - 63.5 * AVGC200.153 - 64.5 * AVGC200.154 - 65.5 * AVGC200.155 - 66.5 * AVGC200.156 - 67.5 * AVGC200.157 - 68.5 * AVGC200.158 - 69.5 * AVGC200.159 - 70.5 * AVGC200.160 - 71.5 * AVGC200.161 - 72.5 * AVGC200.162 - 73.5 * AVGC200.163 - 74.5 * AVGC200.164 - 75.5 * AVGC200.165 - 76.5 * AVGC200.166 - 77.5 * AVGC200.167 - 78.5 * AVGC200.168 - 79.5 * AVGC200.169 - 80.5 * AVGC200.170 - 81.5 * AVGC200.171 - 82.5 * AVGC200.172 - 83.5 * AVGC200.173 - 84.5 * AVGC200.174 - 85.5 * AVGC200.175 - 86.5 * AVGC200.176 - 87.5 * AVGC200.177 - 88.5 * AVGC200.178 - 89.5 * AVGC200.179) / 485985
15 period linear regression slope of 20 period simple moving average:
(7 * AVGC20 + 6 * AVGC20.1 + 5 * AVGC20.2 + 4 * AVGC20.3 + 3 * AVGC20.4 + 2 * AVGC20.5 + AVGC20.6 - AVGC20.8 - 2 * AVGC20.9 - 3 * AVGC20.10 - 4 * AVGC20.11 - 5 * AVGC20.12 - 6 * AVGC20.13 - 7 * AVGC20.14) / 280
30 period linear regression slope of 20 period simple moving average:
(14.5 * AVGC20 + 13.5 * AVGC20.1 + 12.5 * AVGC20.2 + 11.5 * AVGC20.3 + 10.5 * AVGC20.4 + 9.5 * AVGC20.5 + 8.5 * AVGC20.6 + 7.5 * AVGC20.7 + 6.5 * AVGC20.8 + 5.5 * AVGC20.9 + 4.5 * AVGC20.10 + 3.5 * AVGC20.11 + 2.5 * AVGC20.12 + 1.5 * AVGC20.13 + 0.5 * AVGC20.14 - 0.5 * AVGC20.15 - 1.5 * AVGC20.16 - 2.5 * AVGC20.17 - 3.5 * AVGC20.18 - 4.5 * AVGC20.19 - 5.5 * AVGC20.20 - 6.5 * AVGC20.21 - 7.5 * AVGC20.22 - 8.5 * AVGC20.23 - 9.5 * AVGC20.24 - 10.5 * AVGC20.25 - 11.5 * AVGC20.26 - 12.5 * AVGC20.27 - 13.5 * AVGC20.28 - 14.5 * AVGC20.29) / 2247.5
Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 5/9/2011 Posts: 80
|
Thank you...
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|