vn.py量化社区
By Traders, For Traders.
Member
avatar
加入于:
帖子: 42
声望: 2

数据库中已经预留了这一字段,但没有数据,请问需要在哪个文件中修改?谢谢

Member
avatar
加入于:
帖子: 42
声望: 2

找到更改的地方了, 看回测模块文档。

Member
avatar
加入于:
帖子: 42
声望: 2

只需要修改rqdata.py中的下面这段代码:

    df = rqdata_get_price(
        rq_symbol,
        frequency=rq_interval,
        fields=["open", "high", "low", "close", "volume","open_interest"],
        start_date=start,
        end_date=end,
        adjust_type="none"
    )

    data: List[BarData] = []

    if df is not None:
        for ix, row in df.iterrows():
            bar = BarData(
                symbol=symbol,
                exchange=exchange,
                interval=interval,
                datetime=row.name.to_pydatetime() - adjustment,
                open_price=row["open"],
                high_price=row["high"],
                low_price=row["low"],
                close_price=row["close"],
                volume=row["volume"],
                open_interest=row["open_interest"],
                gateway_name="RQ"
            )
© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3