/opt/alt/python27/lib64/python2.7/site-packages/matplotlib
NameSizeModeActions
backends/-0755rm
delaunay/-0755rm
mpl-data/-0755rm
numerix/-0755rm
projections/-0755rm
sphinxext/-0755rm
afm.py150890644editdlrm
afm.pyc173880644editdlrm
afm.pyo173880644editdlrm
artist.py356230644editdlrm
artist.pyc414310644editdlrm
artist.pyo414310644editdlrm
axes.py2800890644editdlrm
axes.pyc2525680644editdlrm
axes.pyo2514560644editdlrm
axis.py573540644editdlrm
axis.pyc608580644editdlrm
axis.pyo605510644editdlrm
backend_bases.py723180644editdlrm
backend_bases.pyc799690644editdlrm
backend_bases.pyo798790644editdlrm
bezier.py149170644editdlrm
bezier.pyc138120644editdlrm
bezier.pyo138120644editdlrm
blocking_input.py136900644editdlrm
blocking_input.pyc147620644editdlrm
blocking_input.pyo144440644editdlrm
cbook.py427560644editdlrm
cbook.pyc586920644editdlrm
cbook.pyo584660644editdlrm
cm.py80980644editdlrm
cm.pyc100320644editdlrm
cm.pyo100320644editdlrm
collections.py407840644editdlrm
collections.pyc451110644editdlrm
collections.pyo451110644editdlrm
colorbar.py274560644editdlrm
colorbar.pyc258350644editdlrm
colorbar.pyo258350644editdlrm
colors.py391100644editdlrm
colors.pyc406900644editdlrm
colors.pyo406900644editdlrm
contour.py428950644editdlrm
contour.pyc364630644editdlrm
contour.pyo363010644editdlrm
dates.py360070755editdlrm
dates.pyc411350644editdlrm
dates.pyo410710644editdlrm
dviread.py320330644editdlrm
dviread.pyc354880644editdlrm
dviread.pyo353450644editdlrm
figure.py412640644editdlrm
figure.pyc437060644editdlrm
figure.pyo435750644editdlrm
finance.py205820644editdlrm
finance.pyc186750644editdlrm
finance.pyo185150644editdlrm
fontconfig_pattern.py64290644editdlrm
fontconfig_pattern.pyc67100644editdlrm
fontconfig_pattern.pyo67100644editdlrm
font_manager.py426530644editdlrm
font_manager.pyc412750644editdlrm
font_manager.pyo412750644editdlrm
ft2font.so3061680755editdlrm
hatch.py65640644editdlrm
hatch.pyc94840644editdlrm
hatch.pyo94840644editdlrm
image.py315400644editdlrm
image.pyc337830644editdlrm
image.pyo337370644editdlrm
legend.py323020644editdlrm
legend.pyc238760644editdlrm
legend.pyo237030644editdlrm
lines.py546850644editdlrm
lines.pyc579910644editdlrm
lines.pyo578860644editdlrm
mathtext.py1020090644editdlrm
mathtext.pyc1060700644editdlrm
mathtext.pyo1056820644editdlrm
mlab.py942940644editdlrm
mlab.pyc1019150644editdlrm
mlab.pyo1017350644editdlrm
mpl.py7850644editdlrm
mpl.pyc11890644editdlrm
mpl.pyo11890644editdlrm
nxutils.so97040755editdlrm
offsetbox.py298070644editdlrm
offsetbox.pyc348250644editdlrm
offsetbox.pyo347700644editdlrm
patches.py1284850644editdlrm
patches.pyc1337360644editdlrm
patches.pyo1335980644editdlrm
path.py217650644editdlrm
path.pyc214990644editdlrm
path.pyo212790644editdlrm
pylab.py109810644editdlrm
pylab.pyc124380644editdlrm
pylab.pyo124380644editdlrm
pyparsing.py1439240644editdlrm
pyparsing.pyc1511830644editdlrm
pyparsing.pyo1511830644editdlrm
pyplot.py824680644editdlrm
pyplot.pyc819820644editdlrm
pyplot.pyo819820644editdlrm
quiver.py375400644editdlrm
quiver.pyc341520644editdlrm
quiver.pyo341520644editdlrm
rcsetup.py234340644editdlrm
rcsetup.pyc215220644editdlrm
rcsetup.pyo213520644editdlrm
scale.py142330644editdlrm
scale.pyc202540644editdlrm
scale.pyo202540644editdlrm
spines.py126840644editdlrm
spines.pyc118830644editdlrm
spines.pyo114560644editdlrm
table.py168280644editdlrm
table.pyc173730644editdlrm
table.pyo172220644editdlrm
texmanager.py224640644editdlrm
texmanager.pyc202090644editdlrm
texmanager.pyo202090644editdlrm
text.py598220644editdlrm
text.pyc606960644editdlrm
text.pyo606960644editdlrm
ticker.py404280644editdlrm
ticker.pyc521640644editdlrm
ticker.pyo520280644editdlrm
tight_bbox.py36550644editdlrm
tight_bbox.pyc41570644editdlrm
tight_bbox.pyo41570644editdlrm
transforms.py753870644editdlrm
transforms.pyc924320644editdlrm
transforms.pyo915230644editdlrm
ttconv.so654880755editdlrm
type1font.py115370644editdlrm
type1font.pyc114900644editdlrm
type1font.pyo114900644editdlrm
units.py49760644editdlrm
units.pyc59180644editdlrm
units.pyo59180644editdlrm
widgets.py408330644editdlrm
widgets.pyc436080644editdlrm
widgets.pyo434220644editdlrm
windowing.py4540644editdlrm
windowing.pyc13610644editdlrm
windowing.pyo13610644editdlrm
_cm.py3704140644editdlrm
_cm.pyc1030550644editdlrm
_cm.pyo1030550644editdlrm
_cntr.so209600755editdlrm
_delaunay.so611840755editdlrm
_image.so2828560755editdlrm
_mathtext_data.py579900644editdlrm
_mathtext_data.pyc638000644editdlrm
_mathtext_data.pyo638000644editdlrm
_path.so2803120755editdlrm
_png.so1565040755editdlrm
_pylab_helpers.py27150644editdlrm
_pylab_helpers.pyc38380644editdlrm
_pylab_helpers.pyo38380644editdlrm
__init__.py289720644editdlrm
__init__.pyc294350644editdlrm
__init__.pyo293810644editdlrm
Edit: /opt/alt/python27/lib64/python2.7/site-packages/matplotlib/finance.pyo (18515B)
Ñò „ñ™Jc@s;dZddkZddkZddkZddklZyddklZWn#ej oddklZnXyddk Z Wnej oedƒ‚nXddk Z ddk l Z lZddklZddklZdd klZlZdd klZdd klZlZlZdd klZdd klZeƒZ ei!i"e dƒZ#e$e%d„Z&dd„Z(e$e%dd„Z)dddd„Z*ddddd„Z+dddd„Z,ddddd„Z-ddddd„Z.ddddd„Z/ddddd„Z0d d!ddd"„Z1dS(#so A collection of modules for collecting, analyzing and plotting financial data. User contributions welcome! iÿÿÿÿN(turlopen(tmd5s8The finance module requires datetime support (python2.3)(tverboset get_configdir(tdate2num(tBunch(tLineCollectiontPolyCollection(tcolorConverter(tLine2DtTICKLEFTt TICKRIGHT(t Rectangle(tAffine2Ds finance.cachecCsg}|iƒ}d}xx|dD]l}|idƒ}t|ƒdjoq#n|d}|djoIy)d}titi||ƒd Œ} Wq²tj o d}q²Xntiti||ƒd Œ} t | ƒ} g} |dd!D]} | t | ƒqï~ \} }}}t |dƒ}|oBt |d ƒ}||}| |9} ||9}||9}|}n|i | | ||||fƒq#W|i ƒ|ont|ƒdjodSttit|Œƒ\}} }}}}td |d | d |d |d|d|ƒS|SdS(s  Parse the historical data in file handle fh from yahoo finance and return results as a list of d, open, close, high, low, volume where d is a floating poing representation of date, as returned by date2num if adjust=True, use adjusted prices it,iis%Y-%m-%dis%d-%b-%yiitdatetopentclosethightlowtvolumeN(t readlinestNonetsplittlentdatetimeRttimetstrptimet ValueErrorRtfloattinttappendtreversetmaptnptasarraytzipR(tfhtasobjecttadjustedtresultstlinestdatefmttlinetvalstdatestrtdttdt_[1]tvalRRRRRtaclosetmR((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/finance.pytparse_yahoo_historical$sD     # :     # *,c Css|iƒ}|id|i|if}|id|i|if}d}||d|d|d|d|d|d|f}|d jo%tiitt |ƒi ƒƒ}ntii |ƒo't |ƒ}t id||fƒnƒtiitƒptitƒnt|ƒ} t |dƒ}|i| iƒƒ|iƒt id||fƒt |dƒ}|S( se Fetch historical data for ticker between date1 and date2. date1 and date2 are datetime instances Ex: fh = fetch_historical_yahoo('^GSPC', d1, d2) cachename is the name of the local file cache. If None, will default to the md5 hash or the url (which incorporates the ticker and date range) a file handle is returned is_http://table.finance.yahoo.com/table.csv?a=%d&b=%d&c=%d&d=%d&e=%d&f=%d&s=%s&y=0&g=d&ignore=.csviisUsing cachefile %s for %stwsSaved %s data to cache file %strN(tuppertmonthtdaytyearRtostpathtjointcachedirRt hexdigesttexiststfileRtreporttisdirtmkdirRtwritetreadR( ttickertdate1tdate2t cachenametd1td2turlFmtturlR%turlfh((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/finance.pytfetch_historical_yahooXs(  %   c Csht||||ƒ}yt|||ƒ}Wn6tj o*}tidtd|idƒdSX|S(sŒ Get historical data for ticker between date1 and date2. date1 and date2 are datetime instances results are a list of tuples (d, open, close, high, low, volume) where d is a floating poing representation of date, as returned by date2num if asobject is True, the return val is an object with attrs date, open, close, high, low, volume, which are equal length arrays if adjust=True, use adjusted prices Ex: sp = f.quotes_historical_yahoo('^GSPC', d1, d2, asobject=True, adjusted=True) returns = (sp.open[1:] - sp.open[:-1])/sp.open[1:] [n,bins,patches] = hist(returns, 100) mu = mean(returns) sigma = std(returns) x = normpdf(bins, mu, sigma) plot(bins, x, color='red', lw=2) cachename is the name of the local file cache. If None, will default to the md5 hash or the url (which incorporates the ticker and date range) surlopen() failure s iN(RPR4tIOErrortwarningstwarnRNtstrerrorR( RGRHRIR&R'RJR%trettexc((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/finance.pytquotes_historical_yahoo‡s itkR6cCs7g}x |D]}|d \}}} } } | |jo |} n|} td||fd| | fd| dtƒ} td||fd||fd| dtdtd|ƒ}td||fd| | fd| dtd|dtƒ}|i| ||fƒ|i| ƒ|i|ƒ|i|ƒq W|iƒ|S(s% quotes is a list of (time, open, close, high, low, ...) tuples Represent the time, open, close, high, low as a vertical line ranging from low to high. The left tick is the open and the right tick is the close. time must be in float date format - see date2num ax : an Axes instance to plot to ticksize : open/close tick marker in points colorup : the color of the lines where close >= open colordown : the color of the lines where close < open return value is a list of lines added itxdatatydatatcolort antialiasedtmarkert markersize(R tFalseR R textendtadd_linetautoscale_view(taxtquotestticksizetcolorupt colordownR)tqttRRRRR[tvlinetolinetcline((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/finance.pytplot_day_summary®s:       gš™™™™™É?gð?c Cs6|d}g}g}x |D]} | d \} } } } }| | jo|}| }| | }n|}| }| | }td| | fd|| fddddd tƒ}td | ||fd |d |d |d|ƒ}|i|ƒ|i|ƒ|i|ƒ|i|ƒ|i|ƒqW|iƒ||fS(s‰ quotes is a list of (time, open, close, high, low, ...) tuples. As long as the first 5 elements of the tuples are these values, the tuple can be as long as you want (eg it may store volume). time must be in float days format - see date2num Plot the time, open, close, high, low as a vertical line ranging from low to high. Use a rectangular bar to represent the open-close span. If close >= open, use colorup to color the bar, otherwise use colordown ax : an Axes instance to plot to width : fraction of a day for the rectangle width colorup : the color of the rectangle where close >= open colordown : the color of the rectangle where close < open alpha : the rectangle alpha level return value is lines, patches where lines is a list of lines added and patches is a list of the rectangle patches added g@iRYRZR[RXt linewidthgà?R\txytwidththeightt facecolort edgecolor(R tTrueR t set_alphaRRat add_patchRb(RcRdRpRfRgtalphatOFFSETR)tpatchesRhRiRRRRR[tlowerRqRjtrect((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/finance.pyt candlestickìs>          ic)Cs£g}ttt|ƒƒ||ƒD]9\} } } | djo|| | f| | ffq#q#~} | dfd fg} d |dffg}g}ttt|ƒƒ|ƒD]*\} }|djo|| |fq°q°~}g}ttt|ƒƒ|ƒD]*\} }|djo|| |fqq~}|iidd}tƒi|dƒ}ti|ƒ\}}}|||df}ti|ƒ\}}}|||df}h|t 6|t 6}g}t||ƒD];\}}|djo"|djo||||jqÛqÛ~}d}d}t | d|d|d |ƒ}t | d|d |d|d |d |i ƒ} | i |ƒt |d|d |d|d |d |i ƒ}!|!i |ƒdt| ƒ}"}#tg}$|D]} | djo |$| qÞqÞ~$ƒ}%tg}&|D]} | djo |&| qq~&ƒ}'|"|%f|#|'ff}(|i|(ƒ|iƒ|i|ƒ|i| ƒ|i|!ƒ|| |!fS(s³ Represent the time, open, close, high, low as a vertical line ranging from low to high. The left tick is the open and the right tick is the close. ax : an Axes instance to plot to ticksize : size of open and close ticks in points colorup : the color of the lines where close >= open colordown : the color of the lines where close < open return value is a list of lines added iÿÿÿÿigð?gR@gitcolorst linewidthst antialiasedstoffsetst transOffset(ii(ii(i(i(R$txrangeRtfiguretdpiR tscaleRtto_rgbRtR_Rt transDatat set_transformtmintmaxtupdate_datalimRbtadd_collection()RctopenstclosesthighstlowsReRfRgR0tiRRt rangeSegmentst openSegmentst closeSegmentst_[2]Rt offsetsOpent_[3]Rt offsetsCloseR…t tickTransformR6tgtbtcolordt_[4]R}tuseAAtlwtrangeCollectiontopenCollectiontcloseCollectiontminpytmaxxt_[5]tminyt_[6]tmaxytcorners((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/finance.pytplot_day_summary22sXeSS  X        88     gè?c $Csç|d} g} ttt|ƒƒ||ƒD]h\} } } | djoL| djo?| | | | f| | | f| | | f| | | ffq-q-~ }g}ttt|ƒƒ||ƒD]9\} }}|djo|| |f| |ffqÁqÁ~}ti|ƒ\}}}||||f}ti|ƒ\}}}||||f}h|t6|t6}g}t||ƒD];\} } | djo"| djo||| | jqq~}d }d }t|ddd|d|ƒ}t|d |d dd|d|ƒ}dt|ƒ}}t g}|D]}|djo ||q2q2~ƒ} t g}!|D]}|djo |!|qjqj~!ƒ}"|| f||"ff}#|i |#ƒ|i ƒ|i |ƒ|i |ƒ||fS(s‡ Represent the open, close as a bar line and high low range as a vertical line. ax : an Axes instance to plot to width : the bar width in points colorup : the color of the lines where close >= open colordown : the color of the lines where close < open alpha : bar transparency return value is lineCollection, barCollection g@iÿÿÿÿigà?R}iR~Rt facecolorst edgecolors(i(gà?(iiii((iiii(iiii((iiii(R$R‚RRR†RtR_RRR‰RŠR‹RbRŒ($RcRRŽRRRpRfRgRwtdeltaR0R‘RRtbarVertsR•RRR’R6RšR›RœR—R}RžRŸR t barCollectiontminxR¤RR¦R¥R¨R©((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/finance.pyt candlestick2s< ”e  X    88    cCs™ti|ƒ\}} } || | |f}ti|ƒ\}} } || | |f}h|t6|t6} g} t||ƒD];\} }| djo"|djo| | | |jq|q|~ }|d}g}t|ƒD]X\}}|djo?|||df|||f|||f||dffqÛqÛ~}t|d|dd dd dd ƒ}dt|ƒt|ƒff}|i |ƒ|i ƒ|S(s½ Add a volume overlay to the current axes. The opens and closes are used to determine the color of the bar. -1 is missing. If a value is missing on one it must be missing on all ax : an Axes instance to plot to width : the bar width in points colorup : the color of the lines where close >= open colordown : the color of the lines where close < open alpha : bar transparency iÿÿÿÿg@iR«R¬iRR~gà?(iiii((iiii(i(gà?(ii( RR†RtR_R$t enumerateRRRŠR‹Rb(RcRRŽtvolumesRfRgRpRwR6RšR›RœR0RRR}R­R•R‘tvtbarsR¯R©((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/finance.pytvolume_overlayÕs$  X r    c Cs+t||d |d|d||||ƒS(s  Add a volume overlay to the current axes. The closes are used to determine the color of the bar. -1 is missing. If a value is missing on one it must be missing on all ax : an Axes instance to plot to width : the bar width in points colorup : the color of the lines where close >= open colordown : the color of the lines where close < open alpha : bar transparency nb: first point is not displayed - it is used only for choosing the right color iÿÿÿÿi(R¶(RcRŽR³RfRgRpRw((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/finance.pytvolume_overlay2sc-Csñti|ƒ\}}}||||f}ti|ƒ\}}}||||f}h|t6|t6} t|Œ\} } } } }}g}t| d | dƒD];\}}|djo"|djo|| ||jq¢q¢~}|id| | d| djƒ|d}| d}g}|D]C\}}}}}}||df||f||f|dffq(~}|iidd}|ii |i i }t ƒi ||ƒ} g}!|D]\}}}}}}|!|q¾~!} g}"| D]}|"|dfqñ~"}#d}$d}%t |d|d dd |$d |%d |#d |iƒ}&|&i| ƒt| ƒt| ƒ}'}(d})tg}*|D]\}}}}}}|*|q†~*ƒ}+|'|)f|(|+ff},|i|,ƒ|i|&ƒ|iƒ|&S(s‡ Add a volume overlay to the current axes. quotes is a list of (d, open, close, high, low, volume) and close-open is used to determine the color of the bar kwarg width : the bar width in points colorup : the color of the lines where close1 >= close0 colordown : the color of the lines where close1 < close0 alpha : bar transparency iÿÿÿÿiig@gð?gR@gà?R«R¬RR~R€R(i(gà?(iiii((iiii(RR†RtR_R$tinsertRƒR„tbboxRqtviewLimR R…RR‡RˆR‰RŠR‹RŒRb(-RcRdRfRgRpRwR6RšR›RœtdatesRRŽRRR³R0tclose0tclose1R}trighttleftR•R/RRRRRRµtsxtsyt barTransformR—Rt offsetsBarsRžRŸR¯R£R¤R¦R¥R¨R©((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/finance.pytvolume_overlay3sF  `"  W3'   9   R›tlcCséti||ƒf}ti||ƒf}|d}| d} g} |D]B} | djo/| | df| | f|| f|dffqJqJ~ } |iidd} |ii|ii}tƒi| |ƒ}g}t |ƒD]*\}} | djo||dfqåqå~}t | d|d|dd d dd |d |i ƒ}|i |ƒdt |ƒ}}d}tg}|D]} | djo || qq~ƒ}||f||ff}|i|ƒ|iƒ|i|ƒ|S(sÄ Add a bar collection graph with height vals (-1 is missing). ax : an Axes instance to plot to width : the bar width in points alpha : bar transparency g@iÿÿÿÿigð?gR@R«R¬RR~gà?R€R(i(gà?(Rtto_rgbaRƒR„R¹RqRºR R…R²RR‡RˆRRŠR‹RbRŒ(RcR,RrRsRpRwR«R¬R¾R¿R0R´RµRÀRÁRÂR•R‘RÃR¯R£R¤R¦R—R¨R©((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/finance.pyt index_bar`s2   VD   8   (2t__doc__R;RRRturllib2RthashlibRt ImportErrorRtnumpyR"t matplotlibRRR»Rtmatplotlib.cbookRtmatplotlib.collectionsRRtmatplotlib.colorsRR)R R R RyR tmatplotlib.transformsR t configdirR<R=R>R_RtR4RRPRWRmR|RªR±R¶R·RÄRÇ(((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/finance.pytsR$  4 /'=  E\ E+H