February 2010 (1)
September 2009 (1)
May 2009 (1)
April 2009 (1)
March 2009 (4)
January 2009 (3)
November 2008 (2)
October 2008 (2)
September 2008 (1)
August 2008 (5)
July 2008 (3)
June 2008 (1)
May 2008 (5)
April 2008 (8)
March 2008 (3)
February 2008 (1)
January 2008 (2)
December 2007 (2)
November 2007 (4)
October 2007 (17)
September 2007 (9)
2007-11-21 21:23:07
The other day I got Joel Greenblatt’s The Little Book That Beats the Market out from the public library. (What money-minded person would buy books that are in the library?)
It’s a light, cute read, but it offers suggestions that accord very well with what I understand of value investing. At the end you are presented with a “Magic Formula” for ranking stocks that is supposed to be likely to do better than the market, and again I should think it would, since it basically selects companies that get the best return on their capital that are currently priced cheapest in the market.
I thought it would be an interesting exercise to write a stock screener for New Zealand and Australia that uses this formula. This would be of some value, because no one seems to be offering such a service here. So I’m going to use Python to do it.
The formula requires you to know various figures about each company. Some are published by Yahoo and other websites, and the others can be derived from published data.
So what I need to do is:
This is clearly going to involve some sort of HTML parsing, so I think my first major technical decision is going to be what to use.
From Stephen on 2007-11-23 10:47:19
Ah, it’s not exactly a bug.
I strip all but a few allowed tags out of any markup and quote them instead. So there will be lots of random damage if you copy/paste with a content-aware clipboard… I guess I’d better put that stripping into the preview step too.
Rendered at 2010-08-01 22:29:36
From Julian on 2007-11-21 23:28:36
“Hey”, I thought, “I’ll see if my library has that book”. Almost:
<table> <tbody> <tr> <td>Title</td> <td>Gu shi wen zhuan = The little book that beats the market / Qiaoer Gelinbulate zhu; Li Jia, Lu Xiaohui yi ; Liu Wenjun yi jiao.</td> </tr> <tr> <!– next row for fieldtag=t –> <td> </td> <td>股市稳赚 = The little book that beats the market / 乔尔 格林布拉特著; 李佳,卢晓暉译.</td> </tr> </tbody> </table>