pandas_reader.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:trading-stock-thailand 作者: adminho 项目源码 文件源码
def plotCandlestick(symbol, startdate, enddate, title="Selected data"): 
    quotes = loadStockQuotes(symbol, startdate, enddate)        
    print(quotes)
    mondays = WeekdayLocator(MONDAY)        # major ticks on the mondays
    alldays = DayLocator()              # minor ticks on the days
    weekFormatter = DateFormatter('%b %d')  # e.g., Jan 12
#   dayFormatter = DateFormatter('%d')    # e.g., 12

    fig, ax = plt.subplots()
    fig.subplots_adjust(bottom=0.2)
    ax.xaxis.set_major_locator(mondays)
    ax.xaxis.set_minor_locator(alldays)
    ax.xaxis.set_major_formatter(weekFormatter)
    #ax.xaxis.set_minor_formatter(dayFormatter)

    #plot_day_summary(ax, quotes, ticksize=3)
    candlestick_ohlc(ax, quotes, width=0.6)

    ax.xaxis_date()
    ax.autoscale_view()
    ax.set_title(title)
    plt.setp(plt.gca().get_xticklabels(), rotation=45, horizontalalignment='right')

    plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号