On Tue, Oct 12, 2010 at 9:23 AM, John Hunter <jdh2...@gmail.com> wrote: > On Tue, Oct 12, 2010 at 10:55 AM, Keith Goodman <kwgood...@gmail.com> wrote: >> Thanks for the code. I added matplotlib's yahoo historical quote code >> to my labeled array package, la. While doing so I noticed a couple of >> possible bugs: >> >> - The doc string for parse_yahoo_historical says that the volume is >> adjusted. But I don't see a line of code that does the adjustment. > > We don't do the adjustment, Yahoo does. Eg, take a look at CROX > around their 6/15/07 split. > > http://finance.yahoo.com/q/hp?s=CROX&a=05&b=1&c=2007&d=06&e=1&f=2007&g=d > > IDC reports consolidated volume on 6/14/07 (pre-split) was 4,366,319 > shares. Yahoo reports 8,726,000 -- which is close to 2x the raw > volume (I assume the difference is in how some of the shares > transacted on non-primary exchanges are counted). Likewise, on > 6/13/07, IDC reports > 7,852,268 and Yahoo reports 15,544,200, which is close to 2x. So it > appears they are backward split adjusting the volume.
I knew it was worth it (to me) to report what I thought was a bug. Thanks. Well, then perhaps the doc string needs tweaking? *adjusted* If True (default) replace open, close, high, low, and volume with their adjusted values. The adjustment is by a scale factor, S = adjusted_close/close. Adjusted volume is actual volume divided by S; Adjusted prices are actual prices multiplied by S. Hence, the product of price and volume is unchanged by the adjustment. It does state that volume is adjusted by S (where S contains dividend info). I take it that volume is the same whether adjusted is True or False, which means that dollar volume is not unchanged. ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel