factors_all.py 文件源码

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

项目:algorithm-component-library 作者: quantopian 项目源码 文件源码
def compute(self, today, assets, out, close):

            sig_lines = []

            for col in close.T:
                # get signal line only
                try:
                    _, signal_line, _ = talib.MACD(col, fastperiod=12,
                                                   slowperiod=26, signalperiod=10)
                    sig_lines.append(signal_line[-1])
                # if error calculating, return NaN
                except:
                    sig_lines.append(np.nan)
            out[:] = sig_lines

    # 20-day Stochastic Oscillator
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号