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