当前位置: 首页>>代码示例>>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;未经允许,请勿转载。