def create_candlestick(open, high, low, close, dates=None, direction='both', **kwargs):
 if (dates is not None):
  utils.validate_equal_length(open, high, low, close, dates)
 else:
  utils.validate_equal_length(open, high, low, close)
 validate_ohlc(open, high, low, close, direction, **kwargs)
 if (direction is 'increasing'):
  candle_incr_data = make_increasing_candle(open, high, low, close, dates, **kwargs)
  data = candle_incr_data
 elif (direction is 'decreasing'):
  candle_decr_data = make_decreasing_candle(open, high, low, close, dates, **kwargs)
  data = candle_decr_data
 else:
  candle_incr_data = make_increasing_candle(open, high, low, close, dates, **kwargs)
  candle_decr_data = make_decreasing_candle(open, high, low, close, dates, **kwargs)
  data = (candle_incr_data + candle_decr_data)
 layout = graph_objs.Layout()
 return graph_objs.Figure(data=data, layout=layout)

def create_candlestick ( open , high , low , close , dates = None , direction = 'both' , ** kwargs ) : if ( dates is not None ) : utils . validate_equal_length ( open , high , low , close , dates ) else : utils . validate_equal_length ( open , high , low , close ) validate_ohlc ( open , high , low , close , direction , ** kwargs ) if ( direction is 'increasing' ) : candle_incr_data = make_increasing_candle ( open , high , low , close , dates , ** kwargs ) data = candle_incr_data elif ( direction is 'decreasing' ) : candle_decr_data = make_decreasing_candle ( open , high , low , close , dates , ** kwargs ) data = candle_decr_data else : candle_incr_data = make_increasing_candle ( open , high , low , close , dates , ** kwargs ) candle_decr_data = make_decreasing_candle ( open , high , low , close , dates , ** kwargs ) data = ( candle_incr_data + candle_decr_data ) layout = graph_objs . Layout ( ) return graph_objs . Figure ( data = data , layout = layout )
beta function that creates a candlestick chart .