python类WILLR的实例源码

ta.py 文件源码 项目:dash-technical-charting 作者: plotly 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def add_WILLR(self, timeperiod=14,
              type='line', color='secondary', **kwargs):
    """Williams %R."""

    if not (self.has_high and self.has_low and self.has_close):
        raise Exception()

    utils.kwargs_check(kwargs, VALID_TA_KWARGS)
    if 'kind' in kwargs:
        type = kwargs['kind']

    name = 'WILLR({})'.format(str(timeperiod))
    self.sec[name] = dict(type=type, color=color)
    self.ind[name] = talib.WILLR(self.df[self.hi].values,
                                 self.df[self.lo].values,
                                 self.df[self.cl].values,
                                 timeperiod)
abcbase.py 文件源码 项目:zStock 作者: superxhy 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def WR_CN(high, low, close, timeperiod=9):
        return -tl.WILLR(high, low, close, timeperiod)

    #MAX
stock.py 文件源码 项目:autoxd 作者: nessessary 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def WILLR(self):
        """?KDJ??, 0?-20??? 80?-100??"""
        closes = self.getCloses()
        highs = self.getHighs()
        lows = self.getLows()
        return talib.WILLR(highs,lows,closes)

    #----------------------------------------------------------------------
stock.py 文件源码 项目:autoxd 作者: nessessary 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def WILLR(highs, lows, closes):
    """0?-100???, ?KDJ??, 0?-20??? -80?-100??
    return: wr 
    """
    highs = np.array(highs)
    lows = np.array(lows)
    closes = np.array(closes)
    return talib.WILLR(highs,lows,closes)


问题


面经


文章

微信
公众号

扫码关注公众号