@@ -418,16 +418,51 @@ def quotes_historical_yahoo(ticker, date1, date2, asobject=False,
418
418
return ret
419
419
420
420
421
- def plot_day_summary (ax , quotes , ticksize = 3 ,
421
+ def plot_day_summary_oclh (ax , quotes , ticksize = 3 ,
422
422
colorup = 'k' , colordown = 'r' ,
423
423
):
424
424
"""Plots day summary
425
425
426
+ Represent the time, open, close, high, low as a vertical line
427
+ ranging from low to high. The left tick is the open and the right
428
+ tick is the close.
429
+
430
+
431
+
432
+ Parameters
433
+ ----------
434
+ ax : `Axes`
435
+ an `Axes` instance to plot to
436
+ quotes : sequence of (time, open, close, high, low, ...) sequences
437
+ data to plot. time must be in float date format - see date2num
438
+ ticksize : int
439
+ open/close tick marker in points
440
+ colorup : color
441
+ the color of the lines where close >= open
442
+ colordown : color
443
+ the color of the lines where close < open
444
+
445
+ Returns
446
+ -------
447
+ lines : list
448
+ list of tuples of the lines added (one tuple per quote)
449
+ """
450
+ plot_day_summary (ax , quotes , ticksize = ticksize ,
451
+ colorup = colorup , colordown = colordown ,
452
+ ochl = True )
453
+
454
+
455
+ def plot_day_summary_ohlc (ax , quotes , ticksize = 3 ,
456
+ colorup = 'k' , colordown = 'r' ,
457
+ ):
458
+ """Plots day summary
459
+
426
460
Represent the time, open, high, low, close as a vertical line
427
461
ranging from low to high. The left tick is the open and the right
428
462
tick is the close.
429
463
430
464
465
+
431
466
Parameters
432
467
----------
433
468
ax : `Axes`
@@ -444,13 +479,56 @@ def plot_day_summary(ax, quotes, ticksize=3,
444
479
Returns
445
480
-------
446
481
lines : list
447
- list of lines added
482
+ list of tuples of the lines added (one tuple per quote)
448
483
"""
484
+ plot_day_summary (ax , quotes , ticksize = ticksize ,
485
+ colorup = colorup , colordown = colordown ,
486
+ ochl = False )
487
+
488
+
489
+ def plot_day_summary (ax , quotes , ticksize = 3 ,
490
+ colorup = 'k' , colordown = 'r' ,
491
+ ochl = True
492
+ ):
493
+ """Plots day summary
449
494
495
+ This function has been deprecated in 1.4 in favor of
496
+ `plot_day_summary_ochl`, which maintains the original argument
497
+ order, or `plot_day_summary_ohlc`, which uses the
498
+ open-high-low-close order. This function will be removed in 1.5
499
+
500
+
501
+ Represent the time, open, high, low, close as a vertical line
502
+ ranging from low to high. The left tick is the open and the right
503
+ tick is the close.
504
+
505
+
506
+
507
+ Parameters
508
+ ----------
509
+ ax : `Axes`
510
+ an `Axes` instance to plot to
511
+ quotes : sequence of (time, open, high, low, close, ...) sequences
512
+ data to plot. time must be in float date format - see date2num
513
+ ticksize : int
514
+ open/close tick marker in points
515
+ colorup : color
516
+ the color of the lines where close >= open
517
+ colordown : color
518
+ the color of the lines where close < open
519
+
520
+ Returns
521
+ -------
522
+ lines : list
523
+ list of tuples of the lines added (one tuple per quote)
524
+ """
525
+ # unfortunately this has a different return type than plot_day_summary2_*
450
526
lines = []
451
527
for q in quotes :
452
-
453
- t , open , high , low , close = q [:5 ]
528
+ if ochl :
529
+ t , open , close , high , low = q [:5 ]
530
+ else :
531
+ t , open , high , low , close = q [:5 ]
454
532
455
533
if close >= open :
456
534
color = colorup
@@ -572,8 +650,8 @@ def plot_day_summary2(ax, opens, closes, highs, lows, ticksize=4,
572
650
573
651
574
652
This function has been deprecated in 1.4 in favor of
575
- `plot_day_summary_ochl `, which maintains the original argument
576
- order, or `plot_day_summary_ohlc `, which uses the
653
+ `plot_day_summary2_ochl `, which maintains the original argument
654
+ order, or `plot_day_summary2_ohlc `, which uses the
577
655
open-high-low-close order. This function will be removed in 1.5
578
656
579
657
@@ -612,7 +690,7 @@ def plot_day_summary2(ax, opens, closes, highs, lows, ticksize=4,
612
690
colorup , colordown )
613
691
614
692
615
- def plot_day_summary_ochl (ax , opens , closes , highs , lows , ticksize = 4 ,
693
+ def plot_day_summary2_ochl (ax , opens , closes , highs , lows , ticksize = 4 ,
616
694
colorup = 'k' , colordown = 'r' ,
617
695
):
618
696
@@ -649,7 +727,7 @@ def plot_day_summary_ochl(ax, opens, closes, highs, lows, ticksize=4,
649
727
colorup , colordown )
650
728
651
729
652
- def plot_day_summary_ohlc (ax , opens , highs , lows , closes , ticksize = 4 ,
730
+ def plot_day_summary2_ohlc (ax , opens , highs , lows , closes , ticksize = 4 ,
653
731
colorup = 'k' , colordown = 'r' ,
654
732
):
655
733
@@ -681,8 +759,6 @@ def plot_day_summary_ohlc(ax, opens, highs, lows, closes, ticksize=4,
681
759
ret : list
682
760
a list of lines added to the axes
683
761
"""
684
-
685
-
686
762
# note this code assumes if any value open, high, low, close is
687
763
# missing they all are missing
688
764
0 commit comments