factors_all.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:algorithm-component-library 作者: quantopian 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号