|
26 | 26 | from matplotlib.patches import Rectangle
|
27 | 27 | from matplotlib.transforms import Affine2D
|
28 | 28 |
|
| 29 | +from matplotlib import MatplotlibDeprecationWarning as mplDeprecation |
29 | 30 |
|
30 | 31 | configdir = get_configdir()
|
31 | 32 | # cachedir will be None if there is no writable directory.
|
@@ -77,7 +78,7 @@ def parse_yahoo_historical(fh, adjusted=True, asobject=False):
|
77 | 78 |
|
78 | 79 | Otherwise return a numpy recarray with
|
79 | 80 |
|
80 |
| - date, year, month, day, d, open, high, low, close, |
| 81 | + date, year, month, day, d, open, high, low, close, |
81 | 82 | volume, adjusted_close
|
82 | 83 |
|
83 | 84 | where d is a floating poing representation of date,
|
@@ -151,7 +152,7 @@ def fetch_historical_yahoo(ticker, date1, date2, cachename=None,dividends=False)
|
151 | 152 | cachename is the name of the local file cache. If None, will
|
152 | 153 | default to the md5 hash or the url (which incorporates the ticker
|
153 | 154 | and date range)
|
154 |
| - |
| 155 | +
|
155 | 156 | set dividends=True to return dividends instead of price data. With
|
156 | 157 | this option set, parse functions will not work
|
157 | 158 |
|
@@ -374,9 +375,60 @@ def candlestick(ax, quotes, width=0.2, colorup='k', colordown='r',
|
374 | 375 | return lines, patches
|
375 | 376 |
|
376 | 377 |
|
377 |
| -def plot_day_summary2(ax, opens, highs, lows, closes ticksize=4, |
| 378 | +def plot_day_summary2(ax, opens, closes, highs, lows, ticksize=4, |
| 379 | + colorup='k', colordown='r', |
| 380 | + ): |
| 381 | + """ |
| 382 | +
|
| 383 | + Represent the time, open, close, high, low, as a vertical line |
| 384 | + ranging from low to high. The left tick is the open and the right |
| 385 | + tick is the close. |
| 386 | +
|
| 387 | + ax : an Axes instance to plot to |
| 388 | + ticksize : size of open and close ticks in points |
| 389 | + colorup : the color of the lines where close >= open |
| 390 | + colordown : the color of the lines where close < open |
| 391 | +
|
| 392 | + return value is a list of lines added |
| 393 | + """ |
| 394 | + |
| 395 | + warnings.warn("This function has been deprecated in 1.3 in favor" |
| 396 | + "of `plot_day_summary_ochl`," |
| 397 | + "which maintains the natural argument order," |
| 398 | + "or `plot_day_summary_ohlc`," |
| 399 | + "which uses the open-high-low-close order." |
| 400 | + "This function will be removed in 1.4", mplDeprecation) |
| 401 | + return plot_day_summary_ohlc(ax, opens, highs, lows, closes, ticksize, |
| 402 | + colorup, colordown) |
| 403 | + |
| 404 | + |
| 405 | +def plot_day_summary_ochl(ax, opens, closes, highs, lows, ticksize=4, |
| 406 | + colorup='k', colordown='r', |
| 407 | + ): |
| 408 | + |
| 409 | + """ |
| 410 | +
|
| 411 | + Represent the time, open, close, high, low, as a vertical line |
| 412 | + ranging from low to high. The left tick is the open and the right |
| 413 | + tick is the close. |
| 414 | +
|
| 415 | + ax : an Axes instance to plot to |
| 416 | + ticksize : size of open and close ticks in points |
| 417 | + colorup : the color of the lines where close >= open |
| 418 | + colordown : the color of the lines where close < open |
| 419 | +
|
| 420 | + return value is a list of lines added |
| 421 | + """ |
| 422 | + |
| 423 | + return plot_day_summary_ohlc(ax, opens, highs, lows, closes, ticksize, |
| 424 | + colorup, colordown) |
| 425 | + |
| 426 | + |
| 427 | + |
| 428 | +def plot_day_summary_ohlc(ax, opens, highs, lows, closes, ticksize=4, |
378 | 429 | colorup='k', colordown='r',
|
379 | 430 | ):
|
| 431 | + |
380 | 432 | """
|
381 | 433 |
|
382 | 434 | Represent the time, open, high, low, close as a vertical line
|
|
0 commit comments