def get_hist_data_cache(code, date_start, date_end):
cache_file = bash_stock_tmp + "%s^%s.gzip.pickle" % (date_end, code)
# ?????????????????????
if os.path.isfile(cache_file):
print("######### read from cache #########", cache_file)
return pd.read_pickle(cache_file, compression="gzip")
else:
stock = ts.get_hist_data(code, start=date_start, end=date_end)
stock = stock.sort_index(0) # ???????????
stock.to_pickle(cache_file, compression="gzip")
return stock
评论列表
文章目录