本文整理匯總了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)