Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Custom Indicator -- % of today's price to 50 Day (simple) Moving Average Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
SDGoodGuy
Posted : Thursday, May 3, 2012 1:23:33 PM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 16

Hello ...

I wrote a custom indicator intended to provide me with a % of TODAY's PRICE vs. 50 day SMA.

(C-AVGC50) / AVGC50 ....

The value I get for AVGC50 (today's value for the 50 DAY SIMPLE MOVING AVERAGE) is not correct.

Please advise.

 

Thanks.

Gary

Bruce_L
Posted : Thursday, May 3, 2012 1:26:28 PM


Worden Trainer

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

Since you want a percentage, I would probably use:

100 * (C - AVGC50) / AVGC50

Or the slightly shorter:

100 * (C / AVGC50 - 1)

Can you give me some specific examples where AVGC50 is not returning the 50-Period Simple Moving Average?



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
SDGoodGuy
Posted : Thursday, May 3, 2012 1:29:59 PM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 16

Yes ... the 50 day SMA for ALXN is $68.09 per my TC2000 chart .... the value I receive in the AVGC50 calculation is $89.47

Bruce_L
Posted : Thursday, May 3, 2012 1:33:22 PM


Worden Trainer

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

The 50-Period Simple Moving Average of ALXN on a Daily Chart is currently $89.47.

My best guess would be that your charted 50-Period Simple Moving Average is of something other than Price History such as another Moving Average.

If you hover your mouse pointer over the Moving Average 50 on the chart (on the name of the indicator, not on the indicator itself), it should display its parent indicators. The only thing that should be listed there should be Price History.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
SDGoodGuy
Posted : Thursday, May 3, 2012 1:42:44 PM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 16

Yes .. that's what I'm doing ... I deleted the 50 day SMA line ... and (re)added it ... same thing .... ????

Bruce_L
Posted : Thursday, May 3, 2012 1:44:12 PM


Worden Trainer

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

When you add a Moving Average to the chart, a window comes up which allows you to choose the target of the Moving Average. Make sure you are choosing Price History.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
SDGoodGuy
Posted : Thursday, May 3, 2012 1:46:37 PM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 16

I did .... the line is well below where it should be on the chart I'm guessing

Bruce_L
Posted : Thursday, May 3, 2012 1:49:46 PM


Worden Trainer

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

If you hover your mouse pointer over the Moving Average 50 on the chart, a window will come up. What does it say in that window?

Is the Time Frame on the chart Daily?

I get a number very close to what you are reporting when using a Weekly Time Frame. If a Weekly Time Frame is selected, the charted Moving Average will be a 50-Week Moving Average instead of a 50-Day Moving Average.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
SDGoodGuy
Posted : Thursday, May 3, 2012 1:56:11 PM
Gold Customer Gold Customer

Joined: 10/7/2004
Posts: 16

You are CORRECT .. I had it on a weekly chart .. VERY sorry for the inconvenience ... :-(

Bruce_L
Posted : Thursday, May 3, 2012 1:58:42 PM


Worden Trainer

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

I am happy we were able to figure out the issue.



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