candlestick chart - Fail to plot the 30mins candlebar with candlestick_ohlc in Python -
i try plot 30mins candlebar candlestick_ohlc in python. failed , return weird picture.
ha_bar list time,open,high,low , close.
ha_bar=[(736389.41666666663, 24.317, 25.109, 24.317, 24.29975), (736389.4375, 24.308374999999998, 25.529, 25.027750000000001, 25.027750000000001), (736389.45833333337, 24.668062499999998, 25.977, 25.543499999999998, 25.543499999999998), (736389.47847222222, 25.10578125, 25.898, 25.541249999999998, 25.541249999999998), (736389.5625, 25.323515624999999, 25.818000000000001, 25.454000000000001, 25.454000000000001)] import numpy np import matplotlib.pyplot plt import matplotlib.finance mpf import matplotlib.ticker ticker matplotlib.dates import dateformatter fig, ax = plt.subplots() ax.xaxis.set_major_formatter(dateformatter('%y-%m-%d %h:%m:%s')) mpf.candlestick_ohlc(ax, ha_bar,width=0.6) fig.autofmt_xdate() plt.show() how plot 30mins candlebar?
try setting width=0.001 in mpf.candlestick_ohlc(ax, ha_bar,width=0.6)
Comments
Post a Comment