@@ -107,6 +107,10 @@ def _valid_plot_kwargs():
107
107
'type' : { 'Default' : 'ohlc' ,
108
108
'Description' : 'Plot type: ' + str (_get_valid_plot_types ()),
109
109
'Validator' : lambda value : value in _get_valid_plot_types () },
110
+ 'markevery' : { 'Default' : None ,
111
+ 'Description' : 'markevery: size color shape ' ,
112
+ 'Validator' : lambda value : isinstance (value ,(tuple , list , int ))},
113
+
110
114
111
115
'style' : { 'Default' : None ,
112
116
'Description' : 'plot style; see `mpf.available_styles()`' ,
@@ -407,7 +411,8 @@ def plot( data, **kwargs ):
407
411
moving averages, renko, etc.
408
412
Also provide ability to plot trading signals, and/or addtional user-defined data.
409
413
"""
410
-
414
+ import sys
415
+ sys .stdout = sys .__stdout__
411
416
config = _process_kwargs (kwargs , _valid_plot_kwargs ())
412
417
413
418
# translate alias types:
@@ -492,6 +497,7 @@ def plot( data, **kwargs ):
492
497
else :
493
498
panels = _build_panels (fig , config )
494
499
axA1 = panels .at [config ['main_panel' ],'axes' ][0 ]
500
+ warnings .warn (f"this type is { type (axA1 )} " )
495
501
if config ['volume' ]:
496
502
if config ['volume_panel' ] == config ['main_panel' ]:
497
503
# ohlc and volume on same panel: move volume to secondary axes:
@@ -525,10 +531,10 @@ def plot( data, **kwargs ):
525
531
collections = None
526
532
if ptype == 'line' :
527
533
lw = config ['_width_config' ]['line_width' ]
528
- axA1 .plot (xdates , closes , color = config ['linecolor' ], linewidth = lw )
534
+ pmarkevery = config ['markevery' ]
535
+ axA1 .plot (xdates , closes , 'o' , markevery = pmarkevery , ls = '-' , color = config ['linecolor' ], linewidth = lw , ) else :
529
536
else :
530
537
collections = _construct_mpf_collections (ptype ,dates ,xdates ,opens ,highs ,lows ,closes ,volumes ,config ,style )
531
-
532
538
if ptype in VALID_PMOVE_TYPES :
533
539
collections , calculated_values = collections
534
540
volumes = calculated_values ['volumes' ]
@@ -650,10 +656,35 @@ def plot( data, **kwargs ):
650
656
tlines = [tlines ,]
651
657
for tline_item in tlines :
652
658
line_collections .append (_construct_tline_collections (tline_item , dtix , dates , opens , highs , lows , closes ))
653
-
654
- for collection in line_collections :
655
- if collection is not None :
656
- axA1 .add_collection (collection )
659
+ ### note
660
+ # if config['addplot'] is not None:
661
+ # for panid,row in panels.iterrows():
662
+ # print(panid)
663
+ # print("the value of min and max is ",miny,maxy)
664
+ # print("type of row is ", type(row))
665
+ # print("panid is ",panid)
666
+ # print("row key is ",row.keys())
667
+ # ax = row['axes']
668
+ # line_collections = []
669
+ # if (panid == 0):
670
+ # line_collections.append(_construct_vline_collections(config['vlines'], dtix, miny, maxy))
671
+ # else:
672
+ # line_collections.append(_construct_vline_collections(config['vlines'], dtix, 200, 600))
673
+
674
+ # for collection in line_collections:
675
+ # if collection is not None:
676
+ # ax[0].add_collection(collection)
677
+ if config ['addplot' ] is not None :
678
+ for panid ,row in panels .iterrows ():
679
+ ax = row ['axes' ]
680
+ print (dtix )
681
+ print (config ['vlines' ])
682
+ # _date_to_iloc
683
+ ax [0 ].axvline (x = 50.5 ,linestyle = '--' )
684
+ else :
685
+ for collection in line_collections :
686
+ if collection is not None :
687
+ axA1 .add_collection (collection )
657
688
658
689
datalen = len (xdates )
659
690
if config ['volume' ]:
0 commit comments