QA_fetch_stock_day_adv读取的数据能保存成压缩pickle格式吗?
发布于 1 个月前 作者 pchaos 106 次浏览 来自 问答

data=QA_fetch_stock_day_adv(codelist, firstday - relativedelta(months=7), lastday + relativedelta(months=2)).to_qfq() data能存成pickle吗? 读出来还是前复权吗?想节省每次计算前复权的时间。

1 回复
def getIndexCalret(self, readFromfile, code, startDate, endDate):
    try:
        # 获取指数数据
        dataCalret = decompress_pickle(readFromfile)
    except Exception as e:
        data = qa.QA_fetch_index_day_adv(code, startDate, endDate)
        df = data.add_func(cal_ret)
        compressed_pickle(readFromfile, data.data)
        dataCalret = decompress_pickle(readFromfile)
        data2 = dataCalret
    return dataCalret
回到顶部