From: <jd...@us...> - 2010-10-12 16:17:22
|
Revision: 8742 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8742&view=rev Author: jdh2358 Date: 2010-10-12 16:17:16 +0000 (Tue, 12 Oct 2010) Log Message: ----------- fixed mpl finance buglets identified by Keith Goodman Modified Paths: -------------- branches/v1_0_maint/lib/matplotlib/finance.py Modified: branches/v1_0_maint/lib/matplotlib/finance.py =================================================================== --- branches/v1_0_maint/lib/matplotlib/finance.py 2010-10-11 14:04:43 UTC (rev 8741) +++ branches/v1_0_maint/lib/matplotlib/finance.py 2010-10-12 16:17:16 UTC (rev 8742) @@ -4,7 +4,7 @@ """ #from __future__ import division -import os, time, warnings +import os, warnings from urllib2 import urlopen try: @@ -17,7 +17,7 @@ from matplotlib import verbose, get_configdir from matplotlib.dates import date2num -from matplotlib.cbook import iterable, is_string_like +from matplotlib.cbook import iterable from matplotlib.collections import LineCollection, PolyCollection from matplotlib.colors import colorConverter from matplotlib.lines import Line2D, TICKLEFT, TICKRIGHT @@ -218,7 +218,7 @@ if len(ret) == 0: return None except IOError, exc: - warnings.warn('urlopen() failure\n' + url + '\n' + exc.strerror[1]) + warnings.warn('fh failure\n%s'%(exc.strerror[1])) return None return ret This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2010-10-12 17:21:45
|
Revision: 8747 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8747&view=rev Author: jdh2358 Date: 2010-10-12 17:21:39 +0000 (Tue, 12 Oct 2010) Log Message: ----------- tweak volume docstring for yahoo finance Modified Paths: -------------- branches/v1_0_maint/lib/matplotlib/finance.py Modified: branches/v1_0_maint/lib/matplotlib/finance.py =================================================================== --- branches/v1_0_maint/lib/matplotlib/finance.py 2010-10-12 16:44:07 UTC (rev 8746) +++ branches/v1_0_maint/lib/matplotlib/finance.py 2010-10-12 17:21:39 UTC (rev 8747) @@ -47,13 +47,17 @@ Parse the historical data in file handle fh from yahoo finance. *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. + If True (default) replace open, close, high, and low prices with + their adjusted values. The adjustment is by a scale factor, S = + adjusted_close/close. Adjusted prices are actual prices + multiplied by S. + Volume is not adjusted as it is already backward split adjusted + by Yahoo. If you want to compute dollars traded, multiply volume + by the adjusted close, regardless of whether you choose adjusted + = True|False. + + *asobject* If False (default for compatibility with earlier versions) return a list of tuples containing This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2011-01-04 20:52:48
|
Revision: 8884 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8884&view=rev Author: efiring Date: 2011-01-04 20:52:42 +0000 (Tue, 04 Jan 2011) Log Message: ----------- Finance: change volume to float; close 3108059 Modified Paths: -------------- branches/v1_0_maint/lib/matplotlib/finance.py Modified: branches/v1_0_maint/lib/matplotlib/finance.py =================================================================== --- branches/v1_0_maint/lib/matplotlib/finance.py 2011-01-04 20:36:21 UTC (rev 8883) +++ branches/v1_0_maint/lib/matplotlib/finance.py 2011-01-04 20:52:42 UTC (rev 8884) @@ -38,7 +38,7 @@ ('close', np.float), ('high', np.float), ('low', np.float), - ('volume', np.int), + ('volume', np.float), ('aclose', np.float)]) @@ -57,7 +57,7 @@ by the adjusted close, regardless of whether you choose adjusted = True|False. - + *asobject* If False (default for compatibility with earlier versions) return a list of tuples containing @@ -101,7 +101,7 @@ dt = datetime.date(*[int(val) for val in datestr.split('-')]) dnum = date2num(dt) open, high, low, close = [float(val) for val in vals[1:5]] - volume = int(vals[5]) + volume = float(vals[5]) aclose = float(vals[6]) results.append((dt, dt.year, dt.month, dt.day, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |