问答交流

由hxgre创建,最终由hxgre 被浏览 2 用户

回测主函数中的确没有“fantanbili”,但在 m19_prepare_bigquant_run(context) 函数中,写了如下代码:

def open_pos_con(df):
    return list(df[df['fantanbili']>0].instrument)
# 函数:求满足平仓条件的股票列表
def close_pos_con(df):
    return list(df[df['fantanbili']>0].instrument)

但在传入数据中,即m8模块的预测结果中,并没有fantanbili列,因此dataframe进行切片时会报错

{link}