當前位置: 首頁>>代碼示例>>Python>>正文


Python talib.STOCHRSI屬性代碼示例

本文整理匯總了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] 
開發者ID:mcardillo55,項目名稱:cbpro-trader,代碼行數:6,代碼來源:IndicatorSubsystem.py

示例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) 
開發者ID:QUANTAXIS,項目名稱:QUANTAXIS,代碼行數:6,代碼來源:talib_series.py

示例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) 
開發者ID:plotly,項目名稱:dash-technical-charting,代碼行數:40,代碼來源:ta.py

示例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) 
開發者ID:bpsmith,項目名稱:tia,代碼行數:4,代碼來源:talib_wrapper.py

示例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) 
開發者ID:ranaroussi,項目名稱:qtpylib,代碼行數:6,代碼來源:talib_indicators.py


注:本文中的talib.STOCHRSI屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。