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


Python talib.SAREXT屬性代碼示例

本文整理匯總了Python中talib.SAREXT屬性的典型用法代碼示例。如果您正苦於以下問題:Python talib.SAREXT屬性的具體用法?Python talib.SAREXT怎麽用?Python talib.SAREXT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在talib的用法示例。


在下文中一共展示了talib.SAREXT屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: SAREXT

# 需要導入模塊: import talib [as 別名]
# 或者: from talib import SAREXT [as 別名]
def SAREXT(DataFrame, startvalue=0, offsetonreverse=0, accelerationinitlong=0,
           accelerationlong=0, accelerationmaxlong=0, accelerationinitshort=0, accelerationshort=0, accelerationmaxshort=0):
    res = talib.SAREXT(DataFrame.high.values, DataFrame.low.values,
                       startvalue, offsetonreverse, accelerationinitlong, accelerationlong, accelerationmaxlong,
                       accelerationinitshort, accelerationshort, accelerationmaxshort)
    return pd.DataFrame({'SAREXT': res}, index=DataFrame.index) 
開發者ID:QUANTAXIS,項目名稱:QUANTAXIS,代碼行數:8,代碼來源:talib_indicators.py

示例2: sarext

# 需要導入模塊: import talib [as 別名]
# 或者: from talib import SAREXT [as 別名]
def sarext(self, sym, frequency, *args, **kwargs):
        if not self.kbars_ready(sym, frequency):
            return []

        highs = self.high(sym, frequency)
        lows = self.low(sym, frequency)

        return ta.SAREXT(highs, lows, *args, **kwargs) 
開發者ID:myquant,項目名稱:strategy,代碼行數:10,代碼來源:ta_indicator_mixin.py

示例3: add_SAREXT

# 需要導入模塊: import talib [as 別名]
# 或者: from talib import SAREXT [as 別名]
def add_SAREXT(self, startvalue=0, offsetonreverse=0,
               accelerationinitlong=0.02, accelerationlong=0.02,
               accelerationmaxlong=0.20, accelerationinitshort=0.02,
               accelerationshort=0.02, accelerationmaxshort=0.20,
               type='scatter', color='tertiary', **kwargs):
    """Parabolic SAR Extended."""

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

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

    name = ('SAREXT({},{},{},{},'
            '{},{},{},{})'.format(str(startvalue), str(offsetonreverse),
                                  str(accelerationinitlong),
                                  str(accelerationlong),
                                  str(accelerationmaxlong),
                                  str(accelerationinitshort),
                                  str(accelerationshort),
                                  str(accelerationmaxshort)))
    self.pri[name] = dict(type=type, color=color)
    self.ind[name] = talib.SAREXT(self.df[self.hi].values,
                                  self.df[self.lo].values,
                                  startvalue, offsetonreverse,
                                  accelerationinitlong,
                                  accelerationlong,
                                  accelerationmaxlong,
                                  accelerationinitshort,
                                  accelerationshort,
                                  accelerationmaxshort)
    self.ind[name] = self.ind[name].abs()  # Bug right now with negative value


# Momentum indicators 
開發者ID:plotly,項目名稱:dash-technical-charting,代碼行數:38,代碼來源:ta.py

示例4: sarext

# 需要導入模塊: import talib [as 別名]
# 或者: from talib import SAREXT [as 別名]
def sarext(candles: np.ndarray, startvalue=0, offsetonreverse=0, accelerationinitlong=0, accelerationlong=0,
           accelerationmaxlong=0, accelerationinitshort=0, accelerationshort=0, accelerationmaxshort=0,
           sequential=False) -> Union[float, np.ndarray]:
    """
    SAREXT - Parabolic SAR - Extended

    :param candles: np.ndarray
    :param startvalue: float - default: 0
    :param offsetonreverse: float - default: 0
    :param accelerationinitlong: float - default: 0
    :param accelerationlong: float - default: 0
    :param accelerationmaxlong: float - default: 0
    :param accelerationinitshort: float - default: 0
    :param accelerationshort: float - default: 0
    :param accelerationmaxshort: float - default: 0
    :param sequential: bool - default=False

    :return: float | np.ndarray
    """
    if not sequential and len(candles) > 240:
        candles = candles[-240:]

    res = talib.SAREXT(candles[:, 3], candles[:, 4], startvalue=startvalue, offsetonreverse=offsetonreverse,
                       accelerationinitlong=accelerationinitlong, accelerationlong=accelerationlong,
                       accelerationmaxlong=accelerationmaxlong, accelerationinitshort=accelerationinitshort,
                       accelerationshort=accelerationshort, accelerationmaxshort=accelerationmaxshort)

    return res if sequential else res[-1] 
開發者ID:jesse-ai,項目名稱:jesse,代碼行數:30,代碼來源:sarext.py

示例5: SAREXT

# 需要導入模塊: import talib [as 別名]
# 或者: from talib import SAREXT [as 別名]
def SAREXT(data, **kwargs):
    _check_talib_presence()
    prices = _extract_series(data)
    return talib.SAREXT(prices, **kwargs) 
開發者ID:ranaroussi,項目名稱:qtpylib,代碼行數:6,代碼來源:talib_indicators.py


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