Fundamental Calculation: PEG
Author: thodder
Creation Date: 3/11/2010 10:53 AM
profile picture

thodder

#1
I'm having some difficulty determining how to calculate PEG using the fundamental data provided by WLP using Fidelity data. I got the calculation from this web site: http://stocks.about.com/od/evaluatingstocks/a/peg.htm. Basically it is "PEG = P/E / (projected growth in earnings)". It seemed simply enough; however my attempt to code it using the WLP api appears to get some very far off numbers.
CODE:
Please log in to see this code.

Right off I see that my numbers are wrong for "earnings per share" as I'm getting "-0.03" for MON on 3/10/2010 whereas Fidelity is showing it as $2.75 on their web site.

Any thoughts on what I'm doing wrong? (I assume this is a code problem and not a data problem.)
profile picture

thodder

#2
Actually I may have stumbled onto a bug with "earnings per share" using the FundamentalSeries method. I noticed that "earnings per share" is calculated as "net income" / "common shares outstanding". Instead of using "earnings per share", I did the calculation myself. Using the FundamentalSeries method, you will see that the two indicators plotted are different. It appears the main problem with "earnings per share" is that it is not annualized even though I passed true for the annual parameter with FundamentalSeries. The code below may show the problem.

CODE:
Please log in to see this code.


Change the FundamentalSeries annual parameter to false, and both panes show the same values.
profile picture

Cone

#3
QUOTE:
I'm getting "-0.03" for MON on 3/10/2010 whereas Fidelity is showing it as $2.75 on their web site.
-0.03 is the right number reported by MON on 1/6/2010. MON hasn't even had 1 quarter in at least 6 years where they made more than $0.86/share.

The Strategy builder's calculation looks correct to me for both the mrq and ttm eps.

As for your PEG calculation, you should to compare the current quarter to the prior year's.
profile picture

thodder

#4
Cone,

I'm a little confused by your response. You are correct that -0.03 is the right EPS for MON's last quarter (mrq); however, I was trying to use FundamentalSeries to get the annual value (ttm) of "earnings per share"; however, it only appeared to give me the last quarter.

If I drop "earnings per share" on a chart, I see 1/6/2010 = -0.03; 10/7/2009 = -0.43; 6/24/2009 = 1.27; 4/2/2009 = 2.00. Sum these values up and you have 2.81. That doesn't match Fidelity's 2.75, but it is close (I'm not sure why the difference by Fidelity's web site [2.75], their active trader pro software [3.7788], and Yahoo Finance [2.78] all give different EPS ttm; so I've given up on an exact match).

When I used:
CODE:
Please log in to see this code.


instead of:
CODE:
Please log in to see this code.


That seemed to show the correct ttm value of EPS instead of mrq. My second example illustrates the problem.

I think my PEG calculation may be working now that I am using the code for EPS (ttm):
CODE:
Please log in to see this code.


Tim
profile picture

Cone

#5
Whoops, I was looking at a list of EPS items for AA, not MON. (How does Cramer recall all these earnings details?)

WLP is showing the correct quarterly and annual values in that script based on the data it has available in multiple Fundamental Series. You can't argue with that. Is the problem that it doesn't agree with Fidelity.com? Try using "common shares used to calculate eps diluted".
profile picture

thodder

#6
My issue is with the method call:
QUOTE:
FundamentalsRatio.FundamentalSeries( this, "earnings per share", true )
Even though I have passed true for the boolean annual (for ttm), I still seem to get the most recent quarter.

The strategy below should show "earnings per share" in one pane as ttm and the other as mrq, but notice that both are showing it as mrq:
CODE:
Please log in to see this code.


My first post here had me confused what I was doing wrong in the calculation. I eventually narrowed it down that I was using EPS (mrq) instead of EPS (ttm) because the call to build dsEps was not calculating ttm values.

I want to calculate P/E and PEG in my strategy, so getting EPS correct is critical for both calculations. I'd prefer to use "earnings per share" rather than recalculating it myself.

The data does have me a little confused too as it does not match to Fidelity.com or Yahoo Finance for EPS (mrq) or EPS (ttm); however, I want to ignore that for now as any data errors should be presented to Fidelity not here.
profile picture

thodder

#7
Btw, "earnings per share" does appear to be calculated as "net income" / "common shares outstanding" whereas other sources (Fidelity.com, Yahoo Finance, and Google Finance) all seem to show EPS closer to "net income" / "common shares used to calculate eps diluted".

Is there a reason WLP calculates "earnings per share" differently than other sources? It seems like it is safer for me to recalculate EPS using "net income" / "common shares used to calculate eps diluted" instead of using "earnings per share".

* * *

In my previous post (3/12/2010 8:56 AM), does "DataSeries dsEps = FundamentalsRatio.FundamentalSeries( this, "earnings per share", true );" give you EPS mrq or something different? I am getting mrq when I expected EPS ttm.

If I use "DataSeries dsEps = FundamentalDataSeriesAnnual("earnings per share", 0 );" I get an even different value ($3.86 as of 3/10/2010 when I expect $2.75). FundamentalDataSeriesAnnual appears to sum the past years quarters (range 1/7/2009 thru 10/7/2009) instead of using the most recent quarter (range 4/2/2009 thru 1/6/2010).

I'm still trying to determine the best way to calculate EPS ttm using the WLP available methods. If I need to write my own routines, I will; however, I would expect this to be standard calculations that WLP methods should handle.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).