本文整理汇总了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)
示例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)
示例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
示例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]
示例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)