indicators.py 文件源码

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

项目:gdax-trader 作者: mcardillo55 项目源码 文件源码
def calculate_bbands(self, period_name, close):
        timeperiod = 20
        upperband_1, middleband_1, lowerband_1 = talib.BBANDS(close, timeperiod=timeperiod, nbdevup=1, nbdevdn=1, matype=0)

        self.current_indicators[period_name]['bband_upper_1'] = upperband_1[-1]
        self.current_indicators[period_name]['bband_lower_1'] = lowerband_1[-1]

        upperband_2, middleband_2, lowerband_2 = talib.BBANDS(close, timeperiod=timeperiod, nbdevup=2, nbdevdn=2, matype=0)

        self.current_indicators[period_name]['bband_upper_2'] = upperband_2[-1]
        self.current_indicators[period_name]['bband_lower_2'] = lowerband_2[-1]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号