Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
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
|
|
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
|
|
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
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
XAVG is the function for exponential
- Craig Here to Help!
|
|
Registered User Joined: 10/7/2004 Posts: 799 Location: Duluth, GA
|
very gratifying ... glad you got it solved!
"the Suwamee knows all" :~D
|
|
Guest-1 |