Sunday, August 12, 2018

Top 200 List - Work To Be Done

Top 200 List - Work To Be Done

Well, I knew it would happen at some point.  My nice top 200 workbook, which pulled in data from Fidelity, Morningstar and Yahoo has stopped working.  My son (20 year old working on CS degree) told me my code was "brittle".  Ouch.

The big problem was that Fidelity (which I use as key source as the use Compustat like official website) has changed their source page. And to add insult to injury, they now just show three quarters of data on new source page instead of the four quarters I needed.

But it is ok, every now and then it is good to take a step back.  So I will use this opportunity to revise my approach.  This may take a little while (and may still be brittle).  But I think, if I do it properly, I will have something faster.  My current code basically erases everything and starts fresh each time I run it.  This isn't really very efficient as a lot of numbers may not change... ie if there hasn't been a new earnings report, the only thing that really changes is stock price.

So my idea is that instead of going to websites and pulling in everything, every time I run my report - I will instead do an initial run that looks to see who has new earnings report(10-K or 10-Q).  For them I will need to pull in most recent quarter income + most recent quarter balance sheet entries and share counts. But for the others, I just need new stock price.  So it will be bifurcated.  And since I am only pulling in most recent quarter income, the fact that fidelity only has three quarters of income won't matter.

I definitely have the concept in my head. Now I need to write the macros.  I can see I will have some issues - like what to do with new stocks and what to do with companies that restate earnings.

More to follow, but may be a couple months before I finish.

1 comment:

jb said...

That sounds like a big project to rewrite all that, but it seems that is the nature of the beast with free data sources.
j