Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Write an indicator Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
claudb
Posted : Monday, August 4, 2014 1:01:05 PM
Registered User
Joined: 12/3/2004
Posts: 30
a) compute a 14 day median line regression of the simple 28 day moving average 
    of the close.   as a red histogram.
 
b) Add a black line as a simple 5 day moving average of (a) above
Bruce_L
Posted : Monday, August 4, 2014 1:19:07 PM


Worden Trainer

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

I can calculate the 14-day moving linear regression of the 28-period simple moving average of the close using the least squares method as follows.

AVG(AVGC28,14) + 6.5 * (6.5 * AVGC28 + 5.5 * AVGC28.1 + 4.5 * AVGC28.2 + 3.5 * AVGC28.3 + 2.5 * AVGC28.4 + 1.5 * AVGC28.5 + .5 * AVGC28.6 - .5 * AVGC28.7 - 1.5 * AVGC28.8 - 2.5 * AVGC28.9 - 3.5 * AVGC28.10 - 4.5 * AVGC28.11 - 5.5 * AVGC28.12 - 6.5 * AVGC28.13) / 227.5

But a Median-Median or Triple Median Linear Regression results in a formula which is way to long to be practical or post in the forums.

If the 14-day moving linear regression of the 28-period simple moving average of the close is good enough, then you can use it as the Formula in a Custom PCF Indicator. This would allow you to set the Plot Style and colors of the Custom PCF Indicator as desired. You could then add a moving average to the Custom PCF Indicator and adjust its settings as desired as well.

Adding and Moving Indicators (7:19)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
lorca
Posted : Friday, April 17, 2015 10:07:31 PM
Platinum Customer Platinum Customer

Joined: 7/19/2008
Posts: 2

AVG(AVGC28,14) + 6.5 * (6.5 * AVGC28. + 5.5 * AVGC28.1 + 4.5 * AVGC28.2 + 3.5 * AVGC28.3 + 2.5 * AVGC28.4 + 1.5 * AVGC28.5 + .5 * AVGC28.6 - .5 * AVGC28.7 - 1.5 * AVGC28.8 - 2.5 * AVGC28.9 - 3.5 * AVGC28.10 - 4.5 * AVGC28.11 - 5.5 * AVGC28.12 - 6.5 * AVGC28.13) / 227.5

 bRUCE COPY PASTE IN TC200 AND DONT WORK AND ALL THE INDICATOR  AND EXP ATR EITHER WAY ARE WRONG 

 

LIKE YOU MAKE THE CORRECTION 

THANKS BRUCE

LOOKINF FORWARD FOR AN EXPLANATION

Bruce_L
Posted : Monday, April 20, 2015 12:08:15 PM


Worden Trainer

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

If there is not an option to paste available when right-clicking in the window where you wish to use the formula, you should be able to use ctrl-v to paste instead.

One issue you might experience when using formulas outside of the United States is if your decimal marker is set to use a , instead of set to use a . as would be common in the United States. The only good way around this issue if you don't want to have the decimal markers set to . on your computer would be to re-write any formulas to avoid the use of decimal markers.

For example, the formula given above could be re-written as follows to eliminate the decimal markers.

AVG(AVGC28,14) + 13 * (13 * (AVGC28 - AVGC28.13) + 11 * (AVGC28.1 - AVGC28.12) + 9 * (AVGC28.2 - AVGC28.11) + 7 * (AVGC28.3 - AVGC28.10) + 5 * (AVGC28.4 - AVGC28.9) + 3 * (AVGC28.5 - AVGC28.8) + AVGC28.6 - AVGC28.7) / 910

This was done by multiplying all of the coefficients by 2 and then multiplier denominator by 4 (because of the way the parentheses are placed the coefficients interact in such a way that 2 * 2 = 4).

I don't know what you are saying about "all the indicator and exp ATR either way are wrong." 



-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.