Python talib.SAREXT Examples
The following are 5
code examples of talib.SAREXT().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
talib
, or try the search function
.
Example #1
Source File: ta.py From dash-technical-charting with MIT License | 6 votes |
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
Example #2
Source File: talib_indicators.py From QUANTAXIS with MIT License | 5 votes |
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)
Example #3
Source File: ta_indicator_mixin.py From strategy with Apache License 2.0 | 5 votes |
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)
Example #4
Source File: sarext.py From jesse with MIT License | 5 votes |
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]
Example #5
Source File: talib_indicators.py From qtpylib with Apache License 2.0 | 5 votes |
def SAREXT(data, **kwargs): _check_talib_presence() prices = _extract_series(data) return talib.SAREXT(prices, **kwargs)