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

Is it a bug? Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
wluroc
Posted : Sunday, February 27, 2005 7:24:25 PM
Gold Customer Gold Customer

Joined: 12/3/2004
Posts: 16
I have written a pcf, the formula is as following:

(AVGC50 / AVGC200 - 1) * 100 .

The test value for ICOR is (0.62 / 0.57 - 1.00) * 100.00 = 8.48.

However, when I plot the 50 day and 200 day moving average in the chart, the 50 day MA = 0.59, and 200 day MA = 0.65. If I use these two values in the above pcf, it will be -9.23. Further more, the display in the price chart, 50 day MA is clearly under 200 day MA.
Is the computation of moving average in the chart different from that AVGC used in pcf?

Thanks,

Kenny
Tanstaafl
Posted : Sunday, February 27, 2005 9:36:41 PM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
Hi, Kenny:

The computation of a SIMPLE moving average on the chart, in DAILY display mode, with a fully-updated data file, is exactly the same as the PCF calculation AVGC.

I trust that you understand the precedence of operators .. that is, that the division is done before the subtraction (from your example and comments, it looks like you do).

I suggest you check if you've done a download recently, and a recalc of at least TWO PCF's at the same time after that (this "at least two PCF's" thing is due to a bug in the current TC, but is not an issue in TC2005)

If that's all copacetic, then double check your plot settings ... maybe an exponential crept in somehow. Also check your barlength ... must be at Daily for the PCF to match.

Finally, be sure your cursor is pointing to the same bar that you are calculating the PCF for ... ie the last downloaded bar's date. If you have TCNet, be wary of intraday bars since the last download throwing you off.

I hope that somehow this helps.

Jim Dean

wluroc
Posted : Monday, February 28, 2005 8:38:23 AM
Gold Customer Gold Customer

Joined: 12/3/2004
Posts: 16
Hi, Jim:

Thank you. You are absolutely right. The MA in my pcf is set to simple, while the other is set to exponential.

Kenny
Craig_S
Posted : Monday, February 28, 2005 8:59:59 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
XAVG is the function for exponential

- Craig
Here to Help!
Tanstaafl
Posted : Monday, February 28, 2005 9:01:02 AM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
very gratifying ... glad you got it solved!

"the Suwamee knows all" :~D

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.