Registered User Joined: 2/17/2014 Posts: 11
|
Hi,
how can we calculate slope of 10 periods moving average?
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
A net slope from the previous bar to the current bar could be written as follows.
AVGC10 - AVGC10.1
While the percent slope from one bar to the next can be written as follows.
100 * (AVGC10 / AVGC10.1 - 1)
You could adjust this to say 10 bars by adjusting the bars ago parameter. So the net slope would be:
AVGC10 - AVGC10.10
And the percent slope would be:
100 * (AVGC10 / AVGC10.1 - 1)
Once you go to looking at multiple bar slopes, you could calculate a linear regression slope as well.
(4.5 * AVGC10 + 3.5 * AVGC10.1 + 2.5 * AVGC10.2 + 1.5 * AVGC10.3 + .5 * AVGC10.4 - .5 * AVGC10.5 - 1.5 * AVGC10.6 - 2.5 * AVGC10.7 - 3.5 * AVGC10.8 - 4.5 * AVGC10.9) / 82.5
And express this a percentage of the moving average (or some other basis)
100 * (4.5 * AVGC10 + 3.5 * AVGC10.1 + 2.5 * AVGC10.2 + 1.5 * AVGC10.3 + .5 * AVGC10.4 - .5 * AVGC10.5 - 1.5 * AVGC10.6 - 2.5 * AVGC10.7 - 3.5 * AVGC10.8 - 4.5 * AVGC10.9) / 82.5 / AVGC10
Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 2/17/2014 Posts: 11
|
Hi,
i have just copy and paste
100 * (4.5 * AVGC10 + 3.5 * AVGC10.1 + 2.5 * AVGC10.2 + 1.5 * AVGC10.3 + .5 * AVGC10.4 - .5 * AVGC10.5 - 1.5 * AVGC10.6 - 2.5 * AVGC10.7 - 3.5 * AVGC10.8 - 4.5 * AVGC10.9) / 82.5 / AVGC10
into tc2000 and got message 'Error in formula Argument missing near *'.
Please advise how to solve this issue.
BR
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
My best guess would be that it is the use of a . for the decimal marker if your computer is set to use the , as the decimal marker. Here is a re-write which avoids the use of decimal markers altogether.
100 * (9 * (AVGC10 - AVGC10.9) + 7 * (AVGC10.1 - AVGC10.8) + 5 * (AVGC10.2 - AVGC10.7) + 3 * (AVGC10.3 - AVGC10.6) + AVGC10.4 - AVGC10.5) / 165 / AVGC10
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 2/17/2014 Posts: 11
|
thank you!
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|