def candlestick2(ax, opens, closes, highs, lows, width=<NUM_LIT:4>,<EOL>colorup='<STR_LIT:k>', colordown='<STR_LIT:r>',<EOL>alpha=<NUM_LIT>,<EOL>):
<EOL>delta = width/<NUM_LIT><EOL>barVerts = [ ( (i-delta, open), (i-delta, close), (i+delta, close), (i+delta, open) ) for i, open, close in zip(range(len(opens)), opens, closes) if open != -<NUM_LIT:1> and close!=-<NUM_LIT:1> ]<EOL>rangeSegments = [ ((i, low), (i, high)) for i, low, high in zip(range(len(lows)), lows, highs) if low != -<NUM_LIT:1> ]<EOL>r,g,b = colorConverter.to_rgb(colorup)<EOL>colorup = r,g,b,alpha<EOL>r,g,b = colorConverter.to_rgb(colordown)<EOL>colordown = r,g,b,alpha<EOL>colord = { True : colorup,<EOL>False : colordown,<EOL>}<EOL>colors = [colord[open<close] for open, close in zip(opens, closes) if open!=-<NUM_LIT:1> and close !=-<NUM_LIT:1>]<EOL>assert(len(barVerts)==len(rangeSegments))<EOL>useAA = <NUM_LIT:0>,  <EOL>lw = <NUM_LIT:0.5>,   <EOL>rangeCollection = LineCollection(rangeSegments,<EOL>colors       = ( (<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:1>), ),<EOL>linewidths   = lw,<EOL>antialiaseds = useAA,<EOL>)<EOL>barCollection = PolyCollection(barVerts,<EOL>facecolors   = colors,<EOL>edgecolors   = ( (<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:1>), ),<EOL>antialiaseds = useAA,<EOL>linewidths   = lw,<EOL>)<EOL>minx, maxx = <NUM_LIT:0>, len(rangeSegments)<EOL>miny = min([low for low in lows if low !=-<NUM_LIT:1>])<EOL>maxy = max([high for high in highs if high != -<NUM_LIT:1>])<EOL>corners = (minx, miny), (maxx, maxy)<EOL>ax.update_datalim(corners)<EOL>ax.autoscale_view()<EOL>ax.add_collection(barCollection)<EOL>ax.add_collection(rangeCollection)<EOL>return rangeCollection, barCollection<EOL>
Represent the open, close as a bar line and high low range as a
vertical line.


ax          : an Axes instance to plot to
width       : the bar width in points
colorup     : the color of the lines where close >= open
colordown   : the color of the lines where close <  open
alpha       : bar transparency

return value is lineCollection, barCollection