@@ -66,8 +66,12 @@ def _valid_plot_kwargs():
66
66
'''
67
67
68
68
vkwargs = {
69
- 'type' : { 'Default' : 'ohlc' ,
70
- 'Validator' : lambda value : value in ['candle' ,'candlestick' ,'ohlc' ,'bars' ,'ohlc_bars' ,'line' , 'renko' , 'pnf' , 'p&f' , 'pointnfigure' ] },
69
+ 'columns' : { 'Default' : ('Open' , 'High' , 'Low' , 'Close' , 'Volume' ),
70
+ 'Validator' : lambda value : isinstance (value , (tuple , list ))
71
+ and len (value ) == 5
72
+ and all (isinstance (c , str ) for c in value ) },
73
+ 'type' : { 'Default' : 'ohlc' ,
74
+ 'Validator' : lambda value : value in ['candle' ,'candlestick' ,'ohlc' ,'bars' ,'ohlc_bars' ,'line' , 'renko' , 'pnf' , 'p&f' , 'pointnfigure' ] },
71
75
72
76
'style' : { 'Default' : 'default' ,
73
77
'Validator' : lambda value : value in _styles .available_styles () or isinstance (value ,dict ) },
@@ -169,10 +173,10 @@ def plot( data, **kwargs ):
169
173
Also provide ability to plot trading signals, and/or addtional user-defined data.
170
174
"""
171
175
172
- dates ,opens ,highs ,lows ,closes ,volumes = _check_and_prepare_data (data )
173
-
174
176
config = _process_kwargs (kwargs , _valid_plot_kwargs ())
175
177
178
+ dates ,opens ,highs ,lows ,closes ,volumes = _check_and_prepare_data (data , config )
179
+
176
180
if config ['type' ] in VALID_PMOVE_TYPES and config ['addplot' ] is not None :
177
181
err = "`addplot` is not supported for `type='" + config ['type' ] + "'`"
178
182
raise ValueError (err )
0 commit comments