本文整理汇总了Python中talib.STOCHRSI属性的典型用法代码示例。如果您正苦于以下问题:Python talib.STOCHRSI属性的具体用法?Python talib.STOCHRSI怎么用?Python talib.STOCHRSI使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类talib
的用法示例。
在下文中一共展示了talib.STOCHRSI属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: calculate_stochrsi
# 需要导入模块: import talib [as 别名]
# 或者: from talib import STOCHRSI [as 别名]
def calculate_stochrsi(self, period_name, closing_prices):
fastk, fastd = talib.STOCHRSI(closing_prices, timeperiod=14, fastk_period=3, fastd_period=3, fastd_matype=0)
self.current_indicators[period_name]['stochrsi_fastk'] = fastk[-1]
self.current_indicators[period_name]['stochrsi_fastd'] = fastd[-1]
示例2: STOCHRSI
# 需要导入模块: import talib [as 别名]
# 或者: from talib import STOCHRSI [as 别名]
def STOCHRSI(Series, timeperiod=14, fastk_period=5, fastd_period=3, fastd_matype=0):
fastk, fastd = talib.STOCHRSI(
Series.values, fastk_period, fastd_period, fastd_matype)
return pd.Series(fastk, index=Series.index), pd.Series(fastd, index=Series.index)
示例3: add_STOCHRSI
# 需要导入模块: import talib [as 别名]
# 或者: from talib import STOCHRSI [as 别名]
def add_STOCHRSI(self, timeperiod=14,
fastk_period=5, fastd_period=3, fastd_matype=0,
types=['line', 'line'],
colors=['primary', 'tertiary'],
**kwargs):
"""Stochastic Relative Strength Index.
Note that the first argument of types and colors refers to StochRSI %K
while second argument refers to StochRSI %D
(signal line of %K obtained by MA).
"""
if not self.has_close:
raise Exception()
utils.kwargs_check(kwargs, VALID_TA_KWARGS)
if 'kind' in kwargs:
kwargs['type'] = kwargs['kind']
if 'kinds' in kwargs:
types = kwargs['type']
if 'type' in kwargs:
types = [kwargs['type']] * 2
if 'color' in kwargs:
colors = [kwargs['color']] * 2
name = 'STOCHRSI({},{},{})'.format(str(timeperiod),
str(fastk_period),
str(fastd_period))
fastk = name + r'[%k]'
fastd = name + r'[%d]'
self.sec[fastk] = dict(type=types[0], color=colors[0])
self.sec[fastd] = dict(type=types[1], color=colors[1], on=fastk)
self.ind[fastk], self.ind[fastd] = talib.STOCHRSI(self.df[self.cl].values,
timeperiod,
fastk_period,
fastd_period,
fastd_matype)
示例4: STOCHRSI
# 需要导入模块: import talib [as 别名]
# 或者: from talib import STOCHRSI [as 别名]
def STOCHRSI(series, n=14, fastk=5, fastd=3, fastd_matype=0):
return _series_to_frame(series, ['FAST_K', 'FAST_D'], talib.STOCHRSI, n, fastk, fastd, fastd_matype)
示例5: STOCHRSI
# 需要导入模块: import talib [as 别名]
# 或者: from talib import STOCHRSI [as 别名]
def STOCHRSI(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.STOCHRSI(prices, **kwargs)