|
发表于 2024-8-19 14:54:35
|
显示全部楼层
ts_mean(ts_pct_change(high-low-10, 1), 60)-rank(neg(changepct)/3)/s_sqrt(cube(ts_mean(open, 3)))
7it [00:04, 1.92it/s]Traceback (most recent call last):
File "D:\python_ycsf\datafeed\dataloader.py", line 76, in calc_expr
se = calc_expr(df, field)
File "D:\python_ycsf\datafeed\expr.py", line 21, in calc_expr
se = eval(expr)
File "<string>", line 1, in <module>
NameError: name 'changepct' is not defined
麻烦问下我在这里添加了这个字段,读取文件中也有这个字段,为什么还会报这个字段没有定义呢?
def add_factors(pset):
pset.addTerminal(1, Expr, name='open')
pset.addTerminal(1, Expr, name='high')
pset.addTerminal(1, Expr, name='low')
pset.addTerminal(1, Expr, name='close')
pset.addTerminal(1, Expr, name='volume')
pset.addTerminal(1, Expr, name='changepct') |
|