我正在尝试获得一些技术信息。在此链接中使用其中一些命令:https ://github.com/enigmampc/catalyst/blob/master/catalyst/pipeline/factors/equity/technical.py ,但在 quant.notebook 中我无法获得“从 numexpr 导入评估”,因此未定义评估。我该如何解决这个问题?
从 numexpr 导入评估
class FastochasticOscillator(CustomFactor):
inputs=(USEquityPricing.close,USEquityPricing.high,USEquityPricing.low)
window_safe=True
window_length=14
def compute(self, today, assets, out, closes, highs, lows):
highest_high= nanmax(highs, axis=0)
lowest_low= nanmin(lows, axis=0)
latest_close= closes[-1]
evaluate(
'((tc - ll) / (hh - ll)) * 100',
local_dict={
'tc':latest_close,
'll':lowest_low,
'hh':highest_high,
},
global_dict={},
out=out,
)
K= FastochasticOscillator(window_length=14)
返回管道(列= {
'K':K,
},屏幕=基础)
我正在使用 Quantopian 笔记本,当我尝试导入它时,它给了我这个:InputRejected:从 numexpr 导入评估引发了 ImportError。你的意思是从 numpy 导入 errstate 吗?