indicators.py 文件源码

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

项目:gdax-trader 作者: mcardillo55 项目源码 文件源码
def calculate_macd(self, period_name, closing_prices):
        macd, macd_sig, macd_hist = talib.MACD(closing_prices, fastperiod=12,
                                               slowperiod=26, signalperiod=9)
        self.current_indicators[period_name]['macd'] = macd[-1]
        self.current_indicators[period_name]['macd_sig'] = macd_sig[-1]
        self.current_indicators[period_name]['macd_hist'] = macd_hist[-1]
        self.current_indicators[period_name]['macd_hist_diff'] = Decimal(macd_hist[-1]) - Decimal(macd_hist[-2])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号