def compute(self, today, assets, out, close, high, low):
stoch_list = []
for col_c, col_h, col_l in zip(close.T, high.T, low.T):
try:
_, slowd = talib.STOCH(col_h, col_l, col_c,
fastk_period=5, slowk_period=3, slowk_matype=0,
slowd_period=3, slowd_matype=0)
stoch_list.append(slowd[-1])
# if error calculating
except:
stoch_list.append(np.nan)
out[:] = stoch_list
# 5-day Money Flow / Volume
factors_all.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录